diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs index 54f67895a6..42471d178e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -150,22 +150,33 @@ ) )] // Attributes needed when building as part of the standard library -#![cfg_attr(feature = "stdbuild", feature(staged_api, cfg_target_vendor))] -#![cfg_attr(feature = "stdbuild", feature(link_cfg, repr_packed))] -#![cfg_attr(feature = "stdbuild", allow(warnings))] +#![cfg_attr(feature = "rustc-dep-of-std", feature(staged_api, cfg_target_vendor))] +#![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg, repr_packed))] +#![cfg_attr(feature = "rustc-dep-of-std", feature(no_core))] +#![cfg_attr(feature = "rustc-dep-of-std", no_core)] +#![cfg_attr(feature = "rustc-dep-of-std", allow(warnings))] #![cfg_attr( - feature = "stdbuild", + feature = "rustc-dep-of-std", unstable( feature = "libc", reason = "use `libc` from crates.io", issue = "27783" ) )] -#![cfg_attr(not(feature = "use_std"), no_std)] +#![cfg_attr(not(any(feature = "use_std", feature = "rustc-dep-of-std")), no_std)] #[cfg(all(not(cross_platform_docs), feature = "use_std"))] extern crate std as core; +#[cfg(feature = "rustc-dep-of-std")] +extern crate rustc_std_workspace_core as core; +#[cfg(feature = "rustc-dep-of-std")] +#[allow(unused_imports)] +use core::iter; +#[cfg(feature = "rustc-dep-of-std")] +#[allow(unused_imports)] +use core::option; + #[macro_use] mod macros; |