Skip to content

Commit 2d5dc61

Browse files
authored
Rollup merge of rust-lang#125296 - tesuji:checkcfg-buildstd, r=Nilstrieb,michaelwoerister
Fix `unexpected_cfgs` lint on std closes rust-lang#125291 r? rust-lang/compiler
2 parents 1525484 + aa2aa23 commit 2d5dc61

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

alloc/Cargo.toml

+12
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,15 @@ compiler-builtins-weak-intrinsics = ["compiler_builtins/weak-intrinsics"]
4040
panic_immediate_abort = ["core/panic_immediate_abort"]
4141
# Choose algorithms that are optimized for binary size instead of runtime performance
4242
optimize_for_size = ["core/optimize_for_size"]
43+
44+
[lints.rust.unexpected_cfgs]
45+
level = "warn"
46+
# x.py uses beta cargo, so `check-cfg` entries do not yet take effect
47+
# for rust-lang/rust. But for users of `-Zbuild-std` it does.
48+
# The unused warning is waiting for rust-lang/cargo#13925 to reach beta.
49+
check-cfg = [
50+
'cfg(bootstrap)',
51+
'cfg(no_global_oom_handling)',
52+
'cfg(no_rc)',
53+
'cfg(no_sync)',
54+
]

core/Cargo.toml

+13
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,16 @@ optimize_for_size = []
3636
# Make `RefCell` store additional debugging information, which is printed out when
3737
# a borrow error occurs
3838
debug_refcell = []
39+
40+
[lints.rust.unexpected_cfgs]
41+
level = "warn"
42+
# x.py uses beta cargo, so `check-cfg` entries do not yet take effect
43+
# for rust-lang/rust. But for users of `-Zbuild-std` it does.
44+
# The unused warning is waiting for rust-lang/cargo#13925 to reach beta.
45+
check-cfg = [
46+
'cfg(bootstrap)',
47+
'cfg(no_fp_fmt_parse)',
48+
'cfg(stdarch_intel_sde)',
49+
# This matches `EXTRA_CHECK_CFGS` in `src/bootstrap/src/lib.rs`.
50+
'cfg(feature, values(any()))',
51+
]

std/Cargo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,13 @@ heap_size = 0x8000000
9797
name = "stdbenches"
9898
path = "benches/lib.rs"
9999
test = true
100+
101+
[lints.rust.unexpected_cfgs]
102+
level = "warn"
103+
check-cfg = [
104+
'cfg(bootstrap)',
105+
'cfg(backtrace_in_libstd)',
106+
'cfg(netbsd10)',
107+
'cfg(target_arch, values("xtensa"))',
108+
'cfg(feature, values("std", "as_crate"))',
109+
]

0 commit comments

Comments
 (0)