diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index d7a2c02f0cf2c..ced0f935b4e89 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -867,6 +867,7 @@ impl Config { // Set flags. config.paths = std::mem::take(&mut flags.paths); + config.free_args = std::mem::take(&mut flags.free_args); config.exclude = flags.exclude.into_iter().map(|path| TaskPath::parse(path)).collect(); config.include_default_paths = flags.include_default_paths; config.rustc_error_format = flags.error_format; @@ -879,7 +880,6 @@ impl Config { config.keep_stage = flags.keep_stage; config.keep_stage_std = flags.keep_stage_std; config.color = flags.color; - config.free_args = flags.free_args.clone().unwrap_or_default(); if matches!(flags.deny_warnings, crate::flags::Warnings::Deny) { config.deny_warnings = true; } diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index 33d05723b0524..3755d18a27671 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -149,6 +149,9 @@ pub struct Flags { #[arg(global(true))] /// paths for the subcommand pub paths: Vec, + /// arguments passed to subcommands + #[arg(global(true), last(true), value_name = "ARGS")] + pub free_args: Vec, } impl Flags { diff --git a/src/bootstrap/run.rs b/src/bootstrap/run.rs index e14440f57a8a6..0e1d619f5022f 100644 --- a/src/bootstrap/run.rs +++ b/src/bootstrap/run.rs @@ -184,7 +184,6 @@ impl Step for Miri { miri.arg("--").arg("--target").arg(target.rustc_target_arg()); miri.args(builder.config.cmd.args()); miri.args(&builder.config.free_args); - // miri tests need to know about the stage sysroot miri.env("MIRI_SYSROOT", &miri_sysroot);