File tree 4 files changed +21
-8
lines changed
4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ check-cfg = [
46
46
' cfg(bootstrap)' ,
47
47
' cfg(no_fp_fmt_parse)' ,
48
48
' cfg(stdarch_intel_sde)' ,
49
- # This matches `EXTRA_CHECK_CFGS` in `src/bootstrap/src/lib.rs`.
49
+ # core use #[path] imports to portable-simd `core_simd` crate
50
+ # and to stdarch `core_arch` crate which messes-up with Cargo list
51
+ # of declared features, we therefor expect any feature cfg
50
52
' cfg(feature, values(any()))' ,
51
53
]
Original file line number Diff line number Diff line change @@ -100,10 +100,14 @@ test = true
100
100
101
101
[lints .rust .unexpected_cfgs ]
102
102
level = " warn"
103
+ # x.py uses beta cargo, so `check-cfg` entries do not yet take effect
104
+ # for rust-lang/rust. But for users of `-Zbuild-std` it does.
105
+ # The unused warning is waiting for rust-lang/cargo#13925 to reach beta.
103
106
check-cfg = [
104
107
' cfg(bootstrap)' ,
105
- ' cfg(backtrace_in_libstd)' ,
106
- ' cfg(netbsd10)' ,
107
108
' cfg(target_arch, values("xtensa"))' ,
108
- ' cfg(feature, values("std", "as_crate"))' ,
109
+ # std use #[path] imports to portable-simd `std_float` crate
110
+ # and to the `backtrace` crate which messes-up with Cargo list
111
+ # of declared features, we therefor expect any feature cfg
112
+ ' cfg(feature, values(any()))' ,
109
113
]
Original file line number Diff line number Diff line change @@ -7,9 +7,13 @@ fn main() {
7
7
let target_vendor =
8
8
env:: var ( "CARGO_CFG_TARGET_VENDOR" ) . expect ( "CARGO_CFG_TARGET_VENDOR was not set" ) ;
9
9
let target_env = env:: var ( "CARGO_CFG_TARGET_ENV" ) . expect ( "CARGO_CFG_TARGET_ENV was not set" ) ;
10
+
11
+ println ! ( "cargo:rustc-check-cfg=cfg(netbsd10)" ) ;
10
12
if target_os == "netbsd" && env:: var ( "RUSTC_STD_NETBSD10" ) . is_ok ( ) {
11
13
println ! ( "cargo:rustc-cfg=netbsd10" ) ;
12
14
}
15
+
16
+ println ! ( "cargo:rustc-check-cfg=cfg(restricted_std)" ) ;
13
17
if target_os == "linux"
14
18
|| target_os == "android"
15
19
|| target_os == "netbsd"
@@ -59,8 +63,11 @@ fn main() {
59
63
// - arch=avr
60
64
// - JSON targets
61
65
// - Any new targets that have not been explicitly added above.
62
- println ! ( "cargo:rustc-cfg=feature= \" restricted-std \" " ) ;
66
+ println ! ( "cargo:rustc-cfg=restricted_std " ) ;
63
67
}
64
- println ! ( "cargo:rustc-env=STD_ENV_ARCH={}" , env:: var( "CARGO_CFG_TARGET_ARCH" ) . unwrap( ) ) ;
68
+
69
+ println ! ( "cargo:rustc-check-cfg=cfg(backtrace_in_libstd)" ) ;
65
70
println ! ( "cargo:rustc-cfg=backtrace_in_libstd" ) ;
71
+
72
+ println ! ( "cargo:rustc-env=STD_ENV_ARCH={}" , env:: var( "CARGO_CFG_TARGET_ARCH" ) . unwrap( ) ) ;
66
73
}
Original file line number Diff line number Diff line change 213
213
//! [array]: prim@array
214
214
//! [slice]: prim@slice
215
215
216
- #![ cfg_attr( not( feature = "restricted-std" ) , stable( feature = "rust1" , since = "1.0.0" ) ) ]
216
+ #![ cfg_attr( not( restricted_std ) , stable( feature = "rust1" , since = "1.0.0" ) ) ]
217
217
#![ cfg_attr(
218
- feature = "restricted-std" ,
218
+ restricted_std ,
219
219
unstable(
220
220
feature = "restricted_std" ,
221
221
issue = "none" ,
You can’t perform that action at this time.
0 commit comments