Skip to content

Commit 7a92e36

Browse files
committed
Use rustc_driver::args::raw_args() in Miri
1 parent 37bbed1 commit 7a92e36

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tools/miri/src/bin/miri.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ fn main() {
342342
// (`install_ice_hook` might change `RUST_BACKTRACE`.)
343343
let env_snapshot = env::vars_os().collect::<Vec<_>>();
344344

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

360362
// We cannot use `rustc_driver::main` as we need to adjust the CLI arguments.
361363
run_compiler(
362-
env::args().collect(),
364+
args,
363365
target_crate,
364366
&mut MiriBeRustCompilerCalls { target_crate },
365367
using_internal_features,
@@ -382,7 +384,7 @@ fn main() {
382384

383385
// If user has explicitly enabled/disabled isolation
384386
let mut isolation_enabled: Option<bool> = None;
385-
for arg in env::args() {
387+
for arg in args {
386388
if rustc_args.is_empty() {
387389
// Very first arg: binary name.
388390
rustc_args.push(arg);

0 commit comments

Comments
 (0)