diff options
| author | beetrees <b@beetr.ee> | 2023-05-15 21:22:18 +0100 |
|---|---|---|
| committer | beetrees <b@beetr.ee> | 2024-03-07 00:20:01 +0000 |
| commit | 2d7d0bda4334b1b7be951ff45c4397dab0a1dd32 (patch) | |
| tree | a75252b4611ac5aaaad6b357b95e3d57262a947b | |
| parent | d626d135bc9c2867e029365c51d75a5f7c15e0e8 (diff) | |
| download | rust-2d7d0bda4334b1b7be951ff45c4397dab0a1dd32.tar.gz rust-2d7d0bda4334b1b7be951ff45c4397dab0a1dd32.zip | |
Use `rustc_driver::args::raw_args()` in Miri
| -rw-r--r-- | src/tools/miri/src/bin/miri.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs index 2f37a64576e..a9b5aa5f1ef 100644 --- a/src/tools/miri/src/bin/miri.rs +++ b/src/tools/miri/src/bin/miri.rs @@ -342,6 +342,8 @@ fn main() { // (`install_ice_hook` might change `RUST_BACKTRACE`.) let env_snapshot = env::vars_os().collect::<Vec<_>>(); + let args = rustc_driver::args::raw_args(&early_dcx).unwrap_or_else(|_| std::process::exit(rustc_driver::EXIT_FAILURE)); + // If the environment asks us to actually be rustc, then do that. if let Some(crate_kind) = env::var_os("MIRI_BE_RUSTC") { // Earliest rustc setup. @@ -359,7 +361,7 @@ fn main() { // We cannot use `rustc_driver::main` as we need to adjust the CLI arguments. run_compiler( - env::args().collect(), + args, target_crate, &mut MiriBeRustCompilerCalls { target_crate }, using_internal_features, @@ -382,7 +384,7 @@ fn main() { // If user has explicitly enabled/disabled isolation let mut isolation_enabled: Option<bool> = None; - for arg in env::args() { + for arg in args { if rustc_args.is_empty() { // Very first arg: binary name. rustc_args.push(arg); |
