Skip to content

Commit 67a2533

Browse files
committed
Pass args after -- to subcommands
1 parent 4f4c49b commit 67a2533

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/bootstrap/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ impl Config {
867867

868868
// Set flags.
869869
config.paths = std::mem::take(&mut flags.paths);
870+
config.free_args = std::mem::take(&mut flags.free_args);
870871
config.exclude = flags.exclude.into_iter().map(|path| TaskPath::parse(path)).collect();
871872
config.include_default_paths = flags.include_default_paths;
872873
config.rustc_error_format = flags.error_format;
@@ -879,7 +880,6 @@ impl Config {
879880
config.keep_stage = flags.keep_stage;
880881
config.keep_stage_std = flags.keep_stage_std;
881882
config.color = flags.color;
882-
config.free_args = flags.free_args.clone().unwrap_or_default();
883883
if matches!(flags.deny_warnings, crate::flags::Warnings::Deny) {
884884
config.deny_warnings = true;
885885
}

src/bootstrap/flags.rs

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ pub struct Flags {
149149
#[arg(global(true))]
150150
/// paths for the subcommand
151151
pub paths: Vec<PathBuf>,
152+
/// arguments passed to subcommands
153+
#[arg(global(true), last(true), value_name = "ARGS")]
154+
pub free_args: Vec<String>,
152155
}
153156

154157
impl Flags {

src/bootstrap/run.rs

-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ impl Step for Miri {
184184
miri.arg("--").arg("--target").arg(target.rustc_target_arg());
185185
miri.args(builder.config.cmd.args());
186186
miri.args(&builder.config.free_args);
187-
188187
// miri tests need to know about the stage sysroot
189188
miri.env("MIRI_SYSROOT", &miri_sysroot);
190189

0 commit comments

Comments
 (0)