Skip to content

Commit 0a7c3c2

Browse files
committed
Auto merge of #3365 - rust-lang:rustup-2024-03-08, r=RalfJung
Automatic Rustup
2 parents 09a2776 + 39b56af commit 0a7c3c2

30 files changed

+124
-119
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bfe762e0ed2e95041cc12c02c5565c4368f2cc9f
1+
79d246112dc95bbd67848f7546f3fd1aca516b82

src/concurrency/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
890890
instance,
891891
start_abi,
892892
&[*func_arg],
893-
Some(&ret_place.into()),
893+
Some(&ret_place),
894894
StackPopCleanup::Root { cleanup: true },
895895
)?;
896896

src/eval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
391391
argv,
392392
Scalar::from_u8(sigpipe).into(),
393393
],
394-
Some(&ret_place.into()),
394+
Some(&ret_place),
395395
StackPopCleanup::Root { cleanup: true },
396396
)?;
397397
}
@@ -400,7 +400,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
400400
entry_instance,
401401
Abi::Rust,
402402
&[argc.into(), argv],
403-
Some(&ret_place.into()),
403+
Some(&ret_place),
404404
StackPopCleanup::Root { cleanup: true },
405405
)?;
406406
}

src/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
383383
f: ty::Instance<'tcx>,
384384
caller_abi: Abi,
385385
args: &[Immediate<Provenance>],
386-
dest: Option<&PlaceTy<'tcx, Provenance>>,
386+
dest: Option<&MPlaceTy<'tcx, Provenance>>,
387387
stack_pop: StackPopCleanup,
388388
) -> InterpResult<'tcx> {
389389
let this = self.eval_context_mut();
@@ -401,7 +401,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
401401
let mir = this.load_mir(f.def, None)?;
402402
let dest = match dest {
403403
Some(dest) => dest.clone(),
404-
None => MPlaceTy::fake_alloc_zst(this.layout_of(mir.return_ty())?).into(),
404+
None => MPlaceTy::fake_alloc_zst(this.layout_of(mir.return_ty())?),
405405
};
406406
this.push_stack_frame(f, mir, &dest, stack_pop)?;
407407

src/machine.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
945945
instance: ty::Instance<'tcx>,
946946
abi: Abi,
947947
args: &[FnArg<'tcx, Provenance>],
948-
dest: &PlaceTy<'tcx, Provenance>,
948+
dest: &MPlaceTy<'tcx, Provenance>,
949949
ret: Option<mir::BasicBlock>,
950950
unwind: mir::UnwindAction,
951951
) -> InterpResult<'tcx, Option<(&'mir mir::Body<'tcx>, ty::Instance<'tcx>)>> {
@@ -972,7 +972,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
972972
fn_val: DynSym,
973973
abi: Abi,
974974
args: &[FnArg<'tcx, Provenance>],
975-
dest: &PlaceTy<'tcx, Provenance>,
975+
dest: &MPlaceTy<'tcx, Provenance>,
976976
ret: Option<mir::BasicBlock>,
977977
unwind: mir::UnwindAction,
978978
) -> InterpResult<'tcx> {
@@ -985,7 +985,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
985985
ecx: &mut MiriInterpCx<'mir, 'tcx>,
986986
instance: ty::Instance<'tcx>,
987987
args: &[OpTy<'tcx, Provenance>],
988-
dest: &PlaceTy<'tcx, Provenance>,
988+
dest: &MPlaceTy<'tcx, Provenance>,
989989
ret: Option<mir::BasicBlock>,
990990
unwind: mir::UnwindAction,
991991
) -> InterpResult<'tcx> {

src/shims/backtrace.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1212
abi: Abi,
1313
link_name: Symbol,
1414
args: &[OpTy<'tcx, Provenance>],
15-
dest: &PlaceTy<'tcx, Provenance>,
15+
dest: &MPlaceTy<'tcx, Provenance>,
1616
) -> InterpResult<'tcx> {
1717
let this = self.eval_context_mut();
1818
let [flags] = this.check_shim(abi, Abi::Rust, link_name, args)?;
@@ -32,7 +32,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
3232
abi: Abi,
3333
link_name: Symbol,
3434
args: &[OpTy<'tcx, Provenance>],
35-
dest: &PlaceTy<'tcx, Provenance>,
35+
dest: &MPlaceTy<'tcx, Provenance>,
3636
) -> InterpResult<'tcx> {
3737
let this = self.eval_context_mut();
3838
let tcx = this.tcx;
@@ -145,7 +145,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
145145
abi: Abi,
146146
link_name: Symbol,
147147
args: &[OpTy<'tcx, Provenance>],
148-
dest: &PlaceTy<'tcx, Provenance>,
148+
dest: &MPlaceTy<'tcx, Provenance>,
149149
) -> InterpResult<'tcx> {
150150
let this = self.eval_context_mut();
151151
let [ptr, flags] = this.check_shim(abi, Abi::Rust, link_name, args)?;
@@ -174,7 +174,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
174174
// `lo.col` is 0-based - add 1 to make it 1-based for the caller.
175175
let colno: u32 = u32::try_from(lo.col.0.saturating_add(1)).unwrap_or(0);
176176

177-
let dest = this.force_allocation(dest)?;
178177
if let ty::Adt(adt, _) = dest.layout.ty.kind() {
179178
if !adt.repr().c() {
180179
throw_ub_format!(
@@ -191,29 +190,29 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
191190
let filename_alloc =
192191
this.allocate_str(&filename, MiriMemoryKind::Rust.into(), Mutability::Mut)?;
193192

194-
this.write_immediate(name_alloc.to_ref(this), &this.project_field(&dest, 0)?)?;
195-
this.write_immediate(filename_alloc.to_ref(this), &this.project_field(&dest, 1)?)?;
193+
this.write_immediate(name_alloc.to_ref(this), &this.project_field(dest, 0)?)?;
194+
this.write_immediate(filename_alloc.to_ref(this), &this.project_field(dest, 1)?)?;
196195
}
197196
1 => {
198197
this.write_scalar(
199198
Scalar::from_target_usize(name.len().try_into().unwrap(), this),
200-
&this.project_field(&dest, 0)?,
199+
&this.project_field(dest, 0)?,
201200
)?;
202201
this.write_scalar(
203202
Scalar::from_target_usize(filename.len().try_into().unwrap(), this),
204-
&this.project_field(&dest, 1)?,
203+
&this.project_field(dest, 1)?,
205204
)?;
206205
}
207206
_ => throw_unsup_format!("unknown `miri_resolve_frame` flags {}", flags),
208207
}
209208

210-
this.write_scalar(Scalar::from_u32(lineno), &this.project_field(&dest, 2)?)?;
211-
this.write_scalar(Scalar::from_u32(colno), &this.project_field(&dest, 3)?)?;
209+
this.write_scalar(Scalar::from_u32(lineno), &this.project_field(dest, 2)?)?;
210+
this.write_scalar(Scalar::from_u32(colno), &this.project_field(dest, 3)?)?;
212211

213212
// Support a 4-field struct for now - this is deprecated
214213
// and slated for removal.
215214
if num_fields == 5 {
216-
this.write_pointer(fn_ptr, &this.project_field(&dest, 4)?)?;
215+
this.write_pointer(fn_ptr, &this.project_field(dest, 4)?)?;
217216
}
218217

219218
Ok(())

src/shims/ffi_support.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
7070
fn call_external_c_and_store_return<'a>(
7171
&mut self,
7272
link_name: Symbol,
73-
dest: &PlaceTy<'tcx, Provenance>,
73+
dest: &MPlaceTy<'tcx, Provenance>,
7474
ptr: CodePtr,
7575
libffi_args: Vec<libffi::high::Arg<'a>>,
7676
) -> InterpResult<'tcx, ()> {
@@ -205,7 +205,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
205205
fn call_external_c_fct(
206206
&mut self,
207207
link_name: Symbol,
208-
dest: &PlaceTy<'tcx, Provenance>,
208+
dest: &MPlaceTy<'tcx, Provenance>,
209209
args: &[OpTy<'tcx, Provenance>],
210210
) -> InterpResult<'tcx, bool> {
211211
// Get the pointer to the function in the shared object file if it exists.

src/shims/foreign_items.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
5757
link_name: Symbol,
5858
abi: Abi,
5959
args: &[OpTy<'tcx, Provenance>],
60-
dest: &PlaceTy<'tcx, Provenance>,
60+
dest: &MPlaceTy<'tcx, Provenance>,
6161
ret: Option<mir::BasicBlock>,
6262
unwind: mir::UnwindAction,
6363
) -> InterpResult<'tcx, Option<(&'mir mir::Body<'tcx>, ty::Instance<'tcx>)>> {
@@ -123,7 +123,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
123123
// Second: functions that return immediately.
124124
match this.emulate_foreign_item_inner(link_name, abi, args, dest)? {
125125
EmulateForeignItemResult::NeedsJumping => {
126-
trace!("{:?}", this.dump_place(dest));
126+
trace!("{:?}", this.dump_place(&dest.clone().into()));
127127
this.go_to_block(ret);
128128
}
129129
EmulateForeignItemResult::AlreadyJumped => (),
@@ -149,7 +149,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
149149
sym: DynSym,
150150
abi: Abi,
151151
args: &[OpTy<'tcx, Provenance>],
152-
dest: &PlaceTy<'tcx, Provenance>,
152+
dest: &MPlaceTy<'tcx, Provenance>,
153153
ret: Option<mir::BasicBlock>,
154154
unwind: mir::UnwindAction,
155155
) -> InterpResult<'tcx> {
@@ -401,7 +401,7 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
401401
link_name: Symbol,
402402
abi: Abi,
403403
args: &[OpTy<'tcx, Provenance>],
404-
dest: &PlaceTy<'tcx, Provenance>,
404+
dest: &MPlaceTy<'tcx, Provenance>,
405405
) -> InterpResult<'tcx, EmulateForeignItemResult> {
406406
let this = self.eval_context_mut();
407407

@@ -1085,7 +1085,7 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
10851085
let [op] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
10861086

10871087
let (op, op_len) = this.operand_to_simd(op)?;
1088-
let (dest, dest_len) = this.place_to_simd(dest)?;
1088+
let (dest, dest_len) = this.mplace_to_simd(dest)?;
10891089

10901090
assert_eq!(dest_len, op_len);
10911091

src/shims/intrinsics/atomic.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1818
&mut self,
1919
intrinsic_name: &str,
2020
args: &[OpTy<'tcx, Provenance>],
21-
dest: &PlaceTy<'tcx, Provenance>,
21+
dest: &MPlaceTy<'tcx, Provenance>,
2222
) -> InterpResult<'tcx> {
2323
let this = self.eval_context_mut();
2424

@@ -124,7 +124,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
124124
fn atomic_load(
125125
&mut self,
126126
args: &[OpTy<'tcx, Provenance>],
127-
dest: &PlaceTy<'tcx, Provenance>,
127+
dest: &MPlaceTy<'tcx, Provenance>,
128128
atomic: AtomicReadOrd,
129129
) -> InterpResult<'tcx> {
130130
let this = self.eval_context_mut();
@@ -181,7 +181,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
181181
fn atomic_rmw_op(
182182
&mut self,
183183
args: &[OpTy<'tcx, Provenance>],
184-
dest: &PlaceTy<'tcx, Provenance>,
184+
dest: &MPlaceTy<'tcx, Provenance>,
185185
atomic_op: AtomicOp,
186186
atomic: AtomicRwOrd,
187187
) -> InterpResult<'tcx> {
@@ -223,7 +223,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
223223
fn atomic_exchange(
224224
&mut self,
225225
args: &[OpTy<'tcx, Provenance>],
226-
dest: &PlaceTy<'tcx, Provenance>,
226+
dest: &MPlaceTy<'tcx, Provenance>,
227227
atomic: AtomicRwOrd,
228228
) -> InterpResult<'tcx> {
229229
let this = self.eval_context_mut();
@@ -240,7 +240,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
240240
fn atomic_compare_exchange_impl(
241241
&mut self,
242242
args: &[OpTy<'tcx, Provenance>],
243-
dest: &PlaceTy<'tcx, Provenance>,
243+
dest: &MPlaceTy<'tcx, Provenance>,
244244
success: AtomicRwOrd,
245245
fail: AtomicReadOrd,
246246
can_fail_spuriously: bool,
@@ -269,7 +269,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
269269
fn atomic_compare_exchange(
270270
&mut self,
271271
args: &[OpTy<'tcx, Provenance>],
272-
dest: &PlaceTy<'tcx, Provenance>,
272+
dest: &MPlaceTy<'tcx, Provenance>,
273273
success: AtomicRwOrd,
274274
fail: AtomicReadOrd,
275275
) -> InterpResult<'tcx> {
@@ -279,7 +279,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
279279
fn atomic_compare_exchange_weak(
280280
&mut self,
281281
args: &[OpTy<'tcx, Provenance>],
282-
dest: &PlaceTy<'tcx, Provenance>,
282+
dest: &MPlaceTy<'tcx, Provenance>,
283283
success: AtomicRwOrd,
284284
fail: AtomicReadOrd,
285285
) -> InterpResult<'tcx> {

src/shims/intrinsics/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
2323
&mut self,
2424
instance: ty::Instance<'tcx>,
2525
args: &[OpTy<'tcx, Provenance>],
26-
dest: &PlaceTy<'tcx, Provenance>,
26+
dest: &MPlaceTy<'tcx, Provenance>,
2727
ret: Option<mir::BasicBlock>,
2828
_unwind: mir::UnwindAction,
2929
) -> InterpResult<'tcx> {
@@ -61,7 +61,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
6161
// The rest jumps to `ret` immediately.
6262
this.emulate_intrinsic_by_name(intrinsic_name, instance.args, args, dest)?;
6363

64-
trace!("{:?}", this.dump_place(dest));
64+
trace!("{:?}", this.dump_place(&dest.clone().into()));
6565
this.go_to_block(ret);
6666
Ok(())
6767
}
@@ -72,7 +72,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
7272
intrinsic_name: &str,
7373
generic_args: ty::GenericArgsRef<'tcx>,
7474
args: &[OpTy<'tcx, Provenance>],
75-
dest: &PlaceTy<'tcx, Provenance>,
75+
dest: &MPlaceTy<'tcx, Provenance>,
7676
) -> InterpResult<'tcx> {
7777
let this = self.eval_context_mut();
7878

0 commit comments

Comments
 (0)