Skip to content

Commit bb51abd

Browse files
committed
Forbid running tests on stage 0 unless build.compiletest-allow-stage0 is enabled
1 parent 3dcc9b9 commit bb51abd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,13 +1379,17 @@ impl Config {
13791379
eprintln!("ERROR: cannot run clippy on stage 0. Use at least stage 1.");
13801380
exit!(1);
13811381
}
1382+
(0, Subcommand::Test { .. }) if build_compiletest_allow_stage0 != Some(true) => {
1383+
eprintln!(
1384+
"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`."
1385+
);
1386+
exit!(1);
1387+
}
13821388
_ => {}
13831389
}
13841390

13851391
if config.compile_time_deps && !matches!(config.cmd, Subcommand::Check { .. }) {
1386-
eprintln!(
1387-
"WARNING: Can't use --compile-time-deps with any subcommand other than check."
1388-
);
1392+
eprintln!("ERROR: Can't use --compile-time-deps with any subcommand other than check.");
13891393
exit!(1);
13901394
}
13911395

0 commit comments

Comments
 (0)