From c7d2f4592fb19a8c3d7ae5e6a1594edb4608c75f Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Mon, 20 May 2024 15:06:14 +0000 Subject: [PATCH] addresss reviews --- library/alloc/Cargo.toml | 5 ++++- library/core/Cargo.toml | 6 +++++- src/bootstrap/src/lib.rs | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml index cddf87a92c5..3960f716812 100644 --- a/library/alloc/Cargo.toml +++ b/library/alloc/Cargo.toml @@ -43,9 +43,12 @@ optimize_for_size = ["core/optimize_for_size"] [lints.rust.unexpected_cfgs] level = "warn" +# x.py uses beta cargo, so `check-cfg` entries do not yet take effect +# for rust-lang/rust. But for users of `-Zbuild-std` it does. +# The unused warning is waiting for rust-lang/cargo#13925 to reach beta. check-cfg = [ - 'cfg(no_global_oom_handling)', 'cfg(bootstrap)', + 'cfg(no_global_oom_handling)', 'cfg(no_rc)', 'cfg(no_sync)', ] diff --git a/library/core/Cargo.toml b/library/core/Cargo.toml index 0c86f430f32..756f68e6048 100644 --- a/library/core/Cargo.toml +++ b/library/core/Cargo.toml @@ -39,9 +39,13 @@ debug_refcell = [] [lints.rust.unexpected_cfgs] level = "warn" +# x.py uses beta cargo, so `check-cfg` entries do not yet take effect +# for rust-lang/rust. But for users of `-Zbuild-std` it does. +# The unused warning is waiting for rust-lang/cargo#13925 to reach beta. check-cfg = [ 'cfg(no_fp_fmt_parse)', 'cfg(bootstrap)', 'cfg(stdarch_intel_sde)', - 'cfg(feature, values("all_lane_counts"))', + # This matches `EXTRA_CHECK_CFGS` in `src/bootstrap/src/lib.rs`. + 'cfg(feature, values(any()))', ] diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 698a576effa..0578638de5c 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -84,6 +84,7 @@ const EXTRA_CHECK_CFGS: &[(Option, &str, Option<&[&'static str]>)] = &[ (Some(Mode::ToolRustc), "rust_analyzer", None), (Some(Mode::ToolStd), "rust_analyzer", None), (Some(Mode::Codegen), "parallel_compiler", None), + // NOTE: consider updating `check-cfg` entries in `std/Cargo.toml` too. (Some(Mode::Std), "stdarch_intel_sde", None), (Some(Mode::Std), "no_fp_fmt_parse", None), (Some(Mode::Std), "no_global_oom_handling", None),