From 6e9a1de0d146734e51cc7e761b288e9b9b138d4f Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 31 May 2020 18:09:25 -0700 Subject: Introduce restricted-std feature. --- src/libstd/sys_common/mod.rs | 2 ++ src/libstd/sys_common/mutex.rs | 1 + 2 files changed, 3 insertions(+) (limited to 'src/libstd/sys_common') diff --git a/src/libstd/sys_common/mod.rs b/src/libstd/sys_common/mod.rs index e57bb267cbd..c3e6a5570e6 100644 --- a/src/libstd/sys_common/mod.rs +++ b/src/libstd/sys_common/mod.rs @@ -57,6 +57,7 @@ pub mod mutex; target_os = "cloudabi", target_os = "hermit", target_arch = "wasm32", + feature = "restricted-std", all(target_vendor = "fortanix", target_env = "sgx")))] pub mod os_str_bytes; pub mod poison; @@ -74,6 +75,7 @@ cfg_if::cfg_if! { if #[cfg(any(target_os = "cloudabi", target_os = "l4re", target_os = "hermit", + feature = "restricted-std", all(target_arch = "wasm32", not(target_os = "emscripten")), all(target_vendor = "fortanix", target_env = "sgx")))] { pub use crate::sys::net; diff --git a/src/libstd/sys_common/mutex.rs b/src/libstd/sys_common/mutex.rs index 899fc6a7235..e66d8994147 100644 --- a/src/libstd/sys_common/mutex.rs +++ b/src/libstd/sys_common/mutex.rs @@ -17,6 +17,7 @@ impl Mutex { /// Also, until `init` is called, behavior is undefined if this /// mutex is ever used reentrantly, i.e., `raw_lock` or `try_lock` /// are called by the thread currently holding the lock. + #[rustc_const_stable(feature = "const_sys_mutex_new", since = "1.0.0")] pub const fn new() -> Mutex { Mutex(imp::Mutex::new()) } -- cgit 1.4.1-3-g733a5 From 3d44d3ccfd0a17c6d45bc504be182b47efe1018d Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 7 Jul 2020 10:51:45 -0700 Subject: Simplify os_str_bytes cfg expression. --- src/libstd/sys_common/mod.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/libstd/sys_common') diff --git a/src/libstd/sys_common/mod.rs b/src/libstd/sys_common/mod.rs index c3e6a5570e6..840f9093e00 100644 --- a/src/libstd/sys_common/mod.rs +++ b/src/libstd/sys_common/mod.rs @@ -51,14 +51,9 @@ pub mod condvar; pub mod fs; pub mod io; pub mod mutex; -#[cfg(any(doc, // see `mod os`, docs are generated for multiple platforms - unix, - target_os = "redox", - target_os = "cloudabi", - target_os = "hermit", - target_arch = "wasm32", - feature = "restricted-std", - all(target_vendor = "fortanix", target_env = "sgx")))] +// `doc` is required because `sys/mod.rs` imports `unix/ext/mod.rs` on Windows +// when generating documentation. +#[cfg(any(doc, not(windows)))] pub mod os_str_bytes; pub mod poison; pub mod process; -- cgit 1.4.1-3-g733a5