Skip to content

Commit 1692932

Browse files
author
hyd-dev
committed
Show error if --target-dir is provided more than once
1 parent 8f87903 commit 1692932

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cargo-miri/bin.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,12 @@ fn phase_cargo_miri(mut args: env::Args) {
572572
// Forward all arguments before `--` other than `--target-dir` and its value to Cargo.
573573
for arg in ArgSplitFlagValue::new(&mut args, "--target-dir") {
574574
match arg {
575-
Ok(value) => target_dir = Some(value.into()),
575+
Ok(value) => {
576+
if target_dir.is_some() {
577+
show_error(format!("`--target-dir` is provided more than once"));
578+
}
579+
target_dir = Some(value.into());
580+
}
576581
Err(arg) => drop(cmd.arg(arg)),
577582
}
578583
}

0 commit comments

Comments
 (0)