Skip to content

Commit fb68dc3

Browse files
committed
Replace fake "restricted-std" Cargo feature by custom cfg
1 parent 0606c04 commit fb68dc3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: std/build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fn main() {
1010
if target_os == "netbsd" && env::var("RUSTC_STD_NETBSD10").is_ok() {
1111
println!("cargo:rustc-cfg=netbsd10");
1212
}
13+
println!("cargo:rustc-check-cfg=cfg(restricted_std)");
1314
if target_os == "linux"
1415
|| target_os == "android"
1516
|| target_os == "netbsd"
@@ -59,7 +60,7 @@ fn main() {
5960
// - arch=avr
6061
// - JSON targets
6162
// - Any new targets that have not been explicitly added above.
62-
println!("cargo:rustc-cfg=feature=\"restricted-std\"");
63+
println!("cargo:rustc-cfg=restricted_std");
6364
}
6465
println!("cargo:rustc-env=STD_ENV_ARCH={}", env::var("CARGO_CFG_TARGET_ARCH").unwrap());
6566
println!("cargo:rustc-cfg=backtrace_in_libstd");

Diff for: std/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@
213213
//! [array]: prim@array
214214
//! [slice]: prim@slice
215215
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"))]
217217
#![cfg_attr(
218-
feature = "restricted-std",
218+
restricted_std,
219219
unstable(
220220
feature = "restricted_std",
221221
issue = "none",

0 commit comments

Comments
 (0)