Skip to content

Commit 6f9ca49

Browse files
committed
Fishy --dep fix, things were fishy before, too
1 parent 044a9dc commit 6f9ca49

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

miri-script/src/commands.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,12 @@ impl Command {
499499
let mut early_flags = Vec::<OsString>::new();
500500

501501
// Add target, edition to flags.
502-
if let Some(target) = &target {
503-
early_flags.push("--target".into());
504-
early_flags.push(target.into());
502+
// For `--dep` we need to set the env var instead of passing the flag.
503+
if !dep {
504+
if let Some(target) = &target {
505+
early_flags.push("--target".into());
506+
early_flags.push(target.into());
507+
}
505508
}
506509
if verbose {
507510
early_flags.push("--verbose".into());
@@ -534,7 +537,7 @@ impl Command {
534537
cmd.set_quiet(!verbose);
535538
// Add Miri flags
536539
let mut cmd = cmd.args(&miri_flags).args(&seed_flag).args(&early_flags).args(&flags);
537-
// For `--dep` we also need to set the env var.
540+
// For `--dep` we need to set the env var instead of passing the flag.
538541
if dep {
539542
if let Some(target) = &target {
540543
cmd = cmd.env("MIRI_TEST_TARGET", target);

tests/ui.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,8 @@ fn miri_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
106106
.map(Spanned::dummy)
107107
.into();
108108

109-
config.comment_defaults.base().require_annotations = Spanned::dummy(match mode {
110-
Mode::Pass => false,
111-
Mode::Fail => true,
112-
Mode::RunDep => false,
113-
Mode::Panic => false,
114-
})
115-
.into();
109+
config.comment_defaults.base().require_annotations =
110+
Spanned::dummy(matches!(mode, Mode::Fail)).into();
116111

117112
config.comment_defaults.base().normalize_stderr =
118113
stderr_filters().iter().map(|(m, p)| (m.clone(), p.to_vec())).collect();

0 commit comments

Comments
 (0)