Skip to content

Commit f9721de

Browse files
committed
Improve fidelity of rustc-crates-on-stable test
1 parent e83c45a commit f9721de

File tree

1 file changed

+10
-4
lines changed
  • tests/run-make/rustc-crates-on-stable

1 file changed

+10
-4
lines changed

tests/run-make/rustc-crates-on-stable/rmake.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
use run_make_support::{cargo, rustc_path, source_root};
55

66
fn main() {
7-
// Use the stage0 beta cargo for the compilation (it shouldn't really matter which cargo we use)
7+
// NOTE: in the following cargo invocation, make sure that no unstable cargo flags are used! We
8+
// want to check that these compiler crates can compile on the stable channel, which includes
9+
// treating this cargo as if it was a stable cargo! However, we can't really just "ask" a stage1
10+
// cargo to pretend that it is a stable cargo, because these compiler crates are part of the
11+
// same workspace, which necessarily requires that they can use unstable features and
12+
// experimental editions (like edition 2024).
813
cargo()
9-
// Ensure `proc-macro2`'s nightly detection is disabled
14+
// Ensure `proc-macro2`'s nightly detection is disabled: its build script avoids using
15+
// nightly features when `RUSTC_STAGE` is set.
1016
.env("RUSTC_STAGE", "0")
1117
.env("RUSTC", rustc_path())
12-
// We want to disallow all nightly features to simulate a stable build
13-
.env("RUSTFLAGS", "-Zallow-features=")
18+
// This forces the underlying rustc to think it is a stable rustc.
19+
.env("RUSTC_BOOTSTRAP", "-1")
1420
.arg("build")
1521
.arg("--manifest-path")
1622
.arg(source_root().join("Cargo.toml"))

0 commit comments

Comments
 (0)