Skip to content

Commit 2af2dc5

Browse files
committed
Auto merge of #3367 - rust-lang:rustup-2024-03-09, r=RalfJung
Automatic Rustup
2 parents 120c974 + d3fc322 commit 2af2dc5

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

rust-version

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

src/bin/miri.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ fn main() {
341341
// (`install_ice_hook` might change `RUST_BACKTRACE`.)
342342
let env_snapshot = env::vars_os().collect::<Vec<_>>();
343343

344+
let args = rustc_driver::args::raw_args(&early_dcx)
345+
.unwrap_or_else(|_| std::process::exit(rustc_driver::EXIT_FAILURE));
346+
344347
// If the environment asks us to actually be rustc, then do that.
345348
if let Some(crate_kind) = env::var_os("MIRI_BE_RUSTC") {
346349
// Earliest rustc setup.
@@ -358,7 +361,7 @@ fn main() {
358361

359362
// We cannot use `rustc_driver::main` as we need to adjust the CLI arguments.
360363
run_compiler(
361-
env::args().collect(),
364+
args,
362365
target_crate,
363366
&mut MiriBeRustCompilerCalls { target_crate },
364367
using_internal_features,
@@ -381,7 +384,7 @@ fn main() {
381384

382385
// If user has explicitly enabled/disabled isolation
383386
let mut isolation_enabled: Option<bool> = None;
384-
for arg in env::args() {
387+
for arg in args {
385388
if rustc_args.is_empty() {
386389
// Very first arg: binary name.
387390
rustc_args.push(arg);

src/machine.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::fmt;
88
use std::path::Path;
99
use std::process;
1010

11-
use either::Either;
1211
use rand::rngs::StdRng;
1312
use rand::Rng;
1413
use rand::SeedableRng;
@@ -957,7 +956,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
957956
// to run extra MIR), and Ok(Some(body)) if we found MIR to run for the
958957
// foreign function
959958
// Any needed call to `goto_block` will be performed by `emulate_foreign_item`.
960-
let args = ecx.copy_fn_args(args)?; // FIXME: Should `InPlace` arguments be reset to uninit?
959+
let args = ecx.copy_fn_args(args); // FIXME: Should `InPlace` arguments be reset to uninit?
961960
let link_name = ecx.item_link_name(instance.def_id());
962961
return ecx.emulate_foreign_item(link_name, abi, &args, dest, ret, unwind);
963962
}
@@ -976,7 +975,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
976975
ret: Option<mir::BasicBlock>,
977976
unwind: mir::UnwindAction,
978977
) -> InterpResult<'tcx> {
979-
let args = ecx.copy_fn_args(args)?; // FIXME: Should `InPlace` arguments be reset to uninit?
978+
let args = ecx.copy_fn_args(args); // FIXME: Should `InPlace` arguments be reset to uninit?
980979
ecx.emulate_dyn_sym(fn_val, abi, &args, dest, ret, unwind)
981980
}
982981

@@ -1329,18 +1328,12 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
13291328

13301329
fn protect_in_place_function_argument(
13311330
ecx: &mut InterpCx<'mir, 'tcx, Self>,
1332-
place: &PlaceTy<'tcx, Provenance>,
1331+
place: &MPlaceTy<'tcx, Provenance>,
13331332
) -> InterpResult<'tcx> {
13341333
// If we have a borrow tracker, we also have it set up protection so that all reads *and
13351334
// writes* during this call are insta-UB.
13361335
let protected_place = if ecx.machine.borrow_tracker.is_some() {
1337-
// Have to do `to_op` first because a `Place::Local` doesn't imply the local doesn't have an address.
1338-
if let Either::Left(place) = ecx.place_to_op(place)?.as_mplace_or_imm() {
1339-
ecx.protect_place(&place)?.into()
1340-
} else {
1341-
// Locals that don't have their address taken are as protected as they can ever be.
1342-
place.clone()
1343-
}
1336+
ecx.protect_place(place)?
13441337
} else {
13451338
// No borrow tracker.
13461339
place.clone()

0 commit comments

Comments
 (0)