Skip to content

Commit 70f87db

Browse files
committed
Fix that ./x test --no-doc actually keeps the same behaviour for backwards compatability
1 parent 3b1b0ef commit 70f87db

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

src/bootstrap/src/core/config/flags.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -570,16 +570,21 @@ impl Subcommand {
570570

571571
pub fn test_target(&self) -> TestTarget {
572572
match *self {
573-
Subcommand::Test { all_targets, doc, tests, .. }
574-
| Subcommand::Miri { all_targets, doc, tests, .. } => match (all_targets, doc, tests) {
575-
(true, true, _) | (true, _, true) | (_, true, true) => {
576-
panic!("You can only set one of `--all-targets`, `--doc` and `--tests`.")
573+
Subcommand::Test { mut all_targets, doc, tests, no_doc, .. }
574+
| Subcommand::Miri { mut all_targets, doc, tests, no_doc, .. } => {
575+
// for backwards compatability --no-doc keeps working
576+
all_targets = all_targets || no_doc;
577+
578+
match (all_targets, doc, tests) {
579+
(true, true, _) | (true, _, true) | (_, true, true) => {
580+
panic!("You can only set one of `--all-targets`, `--doc` and `--tests`.")
581+
}
582+
(true, false, false) => TestTarget::AllTargets,
583+
(false, true, false) => TestTarget::DocOnly,
584+
(false, false, true) => TestTarget::Tests,
585+
(false, false, false) => TestTarget::Default,
577586
}
578-
(true, false, false) => TestTarget::AllTargets,
579-
(false, true, false) => TestTarget::DocOnly,
580-
(false, false, true) => TestTarget::Tests,
581-
(false, false, false) => TestTarget::Default,
582-
},
587+
}
583588
_ => TestTarget::Default,
584589
}
585590
}

0 commit comments

Comments
 (0)