Rollup merge of #72172 - Mark-Simulacrum:check-no-stage, r=alexcrichton

Forbid stage arguments to check

Users generally expect that check builds are fast, and that's only true in stage
0 (stages beyond that need us to build a compiler, which is slow).

Closes #69337

r? @alexcrichton
This commit is contained in:
Dylan DPC 2020-05-15 01:57:19 +02:00 committed by GitHub
commit 77096880df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -503,6 +503,20 @@ Arguments:
}
};
if let Subcommand::Check { .. } = &cmd {
if matches.opt_str("stage").is_some() {
println!("{}", "--stage not supported for x.py check, always treated as stage 0");
process::exit(1);
}
if matches.opt_str("keep-stage").is_some() {
println!(
"{}",
"--keep-stage not supported for x.py check, only one stage available"
);
process::exit(1);
}
}
Flags {
verbose: matches.opt_count("verbose"),
stage: matches.opt_str("stage").map(|j| j.parse().expect("`stage` should be a number")),