diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index 4b9e827247e..db4aea6a1ea 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -102,8 +102,6 @@ test = true level = "warn" check-cfg = [ 'cfg(bootstrap)', - 'cfg(backtrace_in_libstd)', - 'cfg(netbsd10)', 'cfg(target_arch, values("xtensa"))', # std use #[path] imports to portable-simd `std_float` crate # and to the `backtrace` crate which messes-up with Cargo list diff --git a/library/std/build.rs b/library/std/build.rs index 04f6f666875..7d975df545e 100644 --- a/library/std/build.rs +++ b/library/std/build.rs @@ -7,9 +7,12 @@ fn main() { let target_vendor = env::var("CARGO_CFG_TARGET_VENDOR").expect("CARGO_CFG_TARGET_VENDOR was not set"); let target_env = env::var("CARGO_CFG_TARGET_ENV").expect("CARGO_CFG_TARGET_ENV was not set"); + + println!("cargo:rustc-check-cfg=cfg(netbsd10)"); if target_os == "netbsd" && env::var("RUSTC_STD_NETBSD10").is_ok() { println!("cargo:rustc-cfg=netbsd10"); } + println!("cargo:rustc-check-cfg=cfg(restricted_std)"); if target_os == "linux" || target_os == "android" @@ -62,6 +65,9 @@ fn main() { // - Any new targets that have not been explicitly added above. println!("cargo:rustc-cfg=restricted_std"); } - println!("cargo:rustc-env=STD_ENV_ARCH={}", env::var("CARGO_CFG_TARGET_ARCH").unwrap()); + + println!("cargo:rustc-check-cfg=cfg(backtrace_in_libstd)"); println!("cargo:rustc-cfg=backtrace_in_libstd"); + + println!("cargo:rustc-env=STD_ENV_ARCH={}", env::var("CARGO_CFG_TARGET_ARCH").unwrap()); } diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index af9fc32c98c..52c94465cd3 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -92,9 +92,6 @@ const EXTRA_CHECK_CFGS: &[(Option, &str, Option<&[&'static str]>)] = &[ (Some(Mode::Std), "no_global_oom_handling", None), (Some(Mode::Std), "no_rc", None), (Some(Mode::Std), "no_sync", None), - (Some(Mode::Std), "netbsd10", None), - (Some(Mode::Std), "backtrace_in_libstd", None), - (Some(Mode::Std), "restricted_std", None), /* Extra values not defined in the built-in targets yet, but used in std */ (Some(Mode::Std), "target_env", Some(&["libnx", "p2"])), (Some(Mode::Std), "target_os", Some(&["visionos"])),