Skip to content

Commit 8a7069f

Browse files
committed
Make stdbuild a cargo feature
1 parent 0b2fe45 commit 8a7069f

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@
8383
))]
8484

8585
// Attributes needed when building as part of the standard library
86-
#![cfg_attr(stdbuild, feature(no_std, staged_api, custom_attribute))]
87-
#![cfg_attr(stdbuild, feature(link_cfg))]
88-
#![cfg_attr(stdbuild, no_std)]
89-
#![cfg_attr(stdbuild, staged_api)]
90-
#![cfg_attr(stdbuild, allow(warnings))]
91-
#![cfg_attr(stdbuild, unstable(feature = "libc",
86+
#![cfg_attr(feature = "stdbuild", feature(no_std, staged_api, custom_attribute))]
87+
#![cfg_attr(feature = "stdbuild", feature(link_cfg))]
88+
#![cfg_attr(feature = "stdbuild", no_std)]
89+
#![cfg_attr(feature = "stdbuild", staged_api)]
90+
#![cfg_attr(feature = "stdbuild", allow(warnings))]
91+
#![cfg_attr(feature = "stdbuild", unstable(feature = "libc",
9292
reason = "use `libc` from crates.io",
9393
issue = "27783"))]
9494

9595
#![cfg_attr(not(feature = "use_std"), no_std)]
9696

97-
#[cfg(all(not(stdbuild), not(dox), feature = "use_std"))]
97+
#[cfg(all(not(dox), feature = "use_std"))]
9898
extern crate std as core;
9999

100100
#[macro_use] mod macros;

src/unix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ cfg_if! {
234234
// on dox builds don't pull in anything
235235
} else if #[cfg(target_os = "l4re")] {
236236
// required libraries for L4Re are linked externally, ATM
237-
} else if #[cfg(all(not(stdbuild), feature = "use_std"))] {
237+
} else if #[cfg(feature = "use_std")] {
238238
// cargo build, don't pull in anything extra as the libstd dep
239239
// already pulls in all libs.
240240
} else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] {

src/windows.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ pub const ENOTEMPTY: ::c_int = 41;
158158
pub const EILSEQ: ::c_int = 42;
159159
pub const STRUNCATE: ::c_int = 80;
160160

161-
#[cfg(all(target_env = "msvc", stdbuild))] // " if " -- appease style checker
161+
// inline comment below appeases style checker
162+
#[cfg(all(target_env = "msvc", feature = "stdbuild"))] // " if "
162163
#[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))]
163164
#[link(name = "libcmt", cfg(target_feature = "crt-static"))]
164165
extern {}

0 commit comments

Comments
 (0)