Skip to content

Commit bda2e89

Browse files
committed
Temporarily make the test cfg a well known bootstrap cfg
1 parent 56e96a6 commit bda2e89

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/bootstrap/src/core/builder/cargo.rs

+2
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ impl Builder<'_> {
624624
// get warnings about it being unexpected.
625625
hostflags.arg("-Zunstable-options");
626626
hostflags.arg("--check-cfg=cfg(bootstrap)");
627+
// #[cfg(bootstrap)] as we are transition `test` to userspace cfg
628+
hostflags.arg("--check-cfg=cfg(test)");
627629

628630
// FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
629631
// but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See

src/bootstrap/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ const LLD_FILE_NAMES: &[&str] = &["ld.lld", "ld64.lld", "lld-link", "wasm-ld"];
7777
#[allow(clippy::type_complexity)] // It's fine for hard-coded list and type is explained above.
7878
const EXTRA_CHECK_CFGS: &[(Option<Mode>, &str, Option<&[&'static str]>)] = &[
7979
(None, "bootstrap", None),
80+
// #[cfg(bootstrap)] to be removed when Cargo is updated
81+
(None, "test", None),
8082
(Some(Mode::Rustc), "llvm_enzyme", None),
8183
(Some(Mode::Codegen), "llvm_enzyme", None),
8284
(Some(Mode::ToolRustc), "llvm_enzyme", None),

0 commit comments

Comments
 (0)