Skip to content

Commit 8088898

Browse files
Rollup merge of #153725 - ferrocene:jh/fix-x-test-no-doc, r=Kobzol
Fix that `./x test --no-doc` actually keeps the same behaviour for backwards compatability In #153143 the `./x test --no-doc` flag was renamed to `--all-targets`. I added a commit that keeps the `--no-doc` flag for backwards compatibility, but unfortunately I forgot to actually keep the behaviour the same, which is fixed by this PR. r? @Kobzol
2 parents 1af198e + 675290a commit 8088898

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 compatibility --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)