Skip to content

Commit 542e750

Browse files
committed
Forbid running tests on stage 0 unless build.compiletest-allow-stage0 is enabled
1 parent 65b7cde commit 542e750

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,12 +1002,18 @@ impl Config {
10021002
(0, Subcommand::Install) => {
10031003
check_stage0("install");
10041004
}
1005+
(0, Subcommand::Test { .. }) if build_compiletest_allow_stage0 != Some(true) => {
1006+
eprintln!(
1007+
"ERROR: cannot test anything on stage 0. Use at least stage 1. If you want to run compiletest with an external stage0 toolchain, enable `build.compiletest-allow-stage0`."
1008+
);
1009+
exit!(1);
1010+
}
10051011
_ => {}
10061012
}
10071013

10081014
if flags_compile_time_deps && !matches!(flags_cmd, Subcommand::Check { .. }) {
10091015
eprintln!(
1010-
"WARNING: Can't use --compile-time-deps with any subcommand other than check."
1016+
"ERROR: Can't use --compile-time-deps with any subcommand other than check."
10111017
);
10121018
exit!(1);
10131019
}

0 commit comments

Comments
 (0)