From 0e2cd33db84a4787391989c69ed3ce70ce8c07ec Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Thu, 4 Mar 2021 14:03:26 +0100 Subject: [PATCH 1/9] Cleanup `std::os` --- library/std/src/os/linux/mod.rs | 1 + library/std/src/os/linux/raw.rs | 1 - library/std/src/os/mod.rs | 163 +++++++++++++++++--------------- library/std/src/os/redox/raw.rs | 1 - library/std/src/sys/mod.rs | 58 +++++------- 5 files changed, 113 insertions(+), 111 deletions(-) diff --git a/library/std/src/os/linux/mod.rs b/library/std/src/os/linux/mod.rs index f179a524336fc..94438defc2270 100644 --- a/library/std/src/os/linux/mod.rs +++ b/library/std/src/os/linux/mod.rs @@ -1,6 +1,7 @@ //! Linux-specific definitions. #![stable(feature = "raw_ext", since = "1.1.0")] +#![doc(cfg(target_os = "linux"))] pub mod fs; pub mod raw; diff --git a/library/std/src/os/linux/raw.rs b/library/std/src/os/linux/raw.rs index 525102212c41e..5b68a7e126268 100644 --- a/library/std/src/os/linux/raw.rs +++ b/library/std/src/os/linux/raw.rs @@ -9,7 +9,6 @@ definitions" )] #![allow(deprecated)] -#![allow(missing_debug_implementations)] use crate::os::raw::c_ulong; diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index b95511e43d844..7e333e2b778d5 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -3,78 +3,93 @@ #![stable(feature = "os", since = "1.0.0")] #![allow(missing_docs, nonstandard_style, missing_debug_implementations)] -// When documenting libstd we want to show unix/windows/linux/wasi modules as these are the "main -// modules" that are used across platforms, so all modules are enabled when `cfg(doc)` is set. -// This should help show platform-specific functionality in a hopefully cross-platform way in the -// documentation. -// Note that we deliberately avoid `cfg_if!` here to work around a rust-analyzer bug that would make -// `std::os` submodules unusable: https://github.com/rust-analyzer/rust-analyzer/issues/6038 - -#[cfg(doc)] -#[stable(feature = "rust1", since = "1.0.0")] -pub use crate::sys::unix_ext as unix; - -#[cfg(doc)] -#[stable(feature = "rust1", since = "1.0.0")] -pub use crate::sys::windows_ext as windows; - -#[cfg(doc)] -#[doc(cfg(target_os = "linux"))] -pub mod linux; - -#[cfg(doc)] -#[stable(feature = "wasi_ext_doc", since = "1.35.0")] -pub use crate::sys::wasi_ext as wasi; - -// If we're not documenting libstd then we just expose the main modules as we otherwise would. - -#[cfg(not(doc))] -#[cfg(any(unix, target_os = "hermit"))] -#[stable(feature = "rust1", since = "1.0.0")] -pub use crate::sys::ext as unix; - -#[cfg(not(doc))] -#[cfg(windows)] -#[stable(feature = "rust1", since = "1.0.0")] -pub use crate::sys::ext as windows; - -#[cfg(not(doc))] -#[cfg(any(target_os = "linux", target_os = "l4re"))] -pub mod linux; - -#[cfg(not(doc))] -#[cfg(target_os = "wasi")] -pub mod wasi; - -#[cfg(target_os = "android")] -pub mod android; -#[cfg(target_os = "dragonfly")] -pub mod dragonfly; -#[cfg(target_os = "emscripten")] -pub mod emscripten; -#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] -pub mod fortanix_sgx; -#[cfg(target_os = "freebsd")] -pub mod freebsd; -#[cfg(target_os = "fuchsia")] -pub mod fuchsia; -#[cfg(target_os = "haiku")] -pub mod haiku; -#[cfg(target_os = "illumos")] -pub mod illumos; -#[cfg(target_os = "ios")] -pub mod ios; -#[cfg(target_os = "macos")] -pub mod macos; -#[cfg(target_os = "netbsd")] -pub mod netbsd; -#[cfg(target_os = "openbsd")] -pub mod openbsd; -#[cfg(target_os = "redox")] -pub mod redox; -#[cfg(target_os = "solaris")] -pub mod solaris; -#[cfg(target_os = "vxworks")] -pub mod vxworks; - pub mod raw; + +cfg_if::cfg_if! { + if #[cfg(all(doc, not(any(target_os = "hermit", + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx")))))]{ + // When documenting std we want to show the `unix`, `windows`, `linux` and `wasi` + // modules as these are the "main modules" that are used across platforms, + // so these modules are enabled when `cfg(doc)` is set. + // This should help show platform-specific functionality in a hopefully cross-platform + // way in the documentation. + + #[stable(feature = "rust1", since = "1.0.0")] + pub use crate::sys::unix_ext as unix; + + pub mod linux; + + #[stable(feature = "wasi_ext_doc", since = "1.35.0")] + pub use crate::sys::wasi_ext as wasi; + + #[stable(feature = "rust1", since = "1.0.0")] + pub use crate::sys::windows_ext as windows; + } else if #[cfg(doc)] { + // On certain platforms right now the "main modules" modules that are + // documented don't compile (missing things in `libc` which is empty), + // so just omit them with an empty module. + + #[unstable(issue = "none", feature = "std_internals")] + pub mod unix {} + + #[unstable(issue = "none", feature = "std_internals")] + pub mod linux {} + + #[unstable(issue = "none", feature = "std_internals")] + pub mod wasi {} + + #[unstable(issue = "none", feature = "std_internals")] + pub mod windows {} + } else { + // If we're not documenting std then we only expose modules appropriate for the + // current platform. + + #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] + pub mod fortanix_sgx; + + #[cfg(any(unix, target_os = "hermit"))] + #[stable(feature = "rust1", since = "1.0.0")] + pub use crate::sys::ext as unix; + #[cfg(target_os = "android")] + pub mod android; + #[cfg(target_os = "dragonfly")] + pub mod dragonfly; + #[cfg(target_os = "emscripten")] + pub mod emscripten; + #[cfg(target_os = "freebsd")] + pub mod freebsd; + #[cfg(target_os = "fuchsia")] + pub mod fuchsia; + #[cfg(target_os = "haiku")] + pub mod haiku; + #[cfg(target_os = "illumos")] + pub mod illumos; + #[cfg(target_os = "ios")] + pub mod ios; + #[cfg(target_os = "l4re")] + pub mod linux; + #[cfg(target_os = "linux")] + pub mod linux; + #[cfg(target_os = "macos")] + pub mod macos; + #[cfg(target_os = "netbsd")] + pub mod netbsd; + #[cfg(target_os = "openbsd")] + pub mod openbsd; + #[cfg(target_os = "redox")] + pub mod redox; + #[cfg(target_os = "solaris")] + pub mod solaris; + + #[cfg(target_os = "vxworks")] + pub mod vxworks; + + #[cfg(target_os = "wasi")] + pub mod wasi; + + #[cfg(windows)] + #[stable(feature = "rust1", since = "1.0.0")] + pub use crate::sys::ext as windows; + } +} diff --git a/library/std/src/os/redox/raw.rs b/library/std/src/os/redox/raw.rs index abe6dfc6b0c51..9a6b99684c523 100644 --- a/library/std/src/os/redox/raw.rs +++ b/library/std/src/os/redox/raw.rs @@ -9,7 +9,6 @@ definitions" )] #![allow(deprecated)] -#![allow(missing_debug_implementations)] use crate::os::raw::{c_char, c_int, c_long, c_ulong, c_void}; diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index 2450a7aac5ede..33e68d12b0a3d 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -49,25 +49,22 @@ cfg_if::cfg_if! { } } -// Import essential modules from both platforms when documenting. These are -// then later used in the `std::os` module when documenting, for example, -// Windows when we're compiling for Linux. +// Import essential modules from platforms used in `std::os` when documenting. +// +// Note that on some platforms those modules don't compile +// (missing things in `libc` which is empty), so they are not included in `std::os` and can be +// omitted here as well. #[cfg(doc)] +#[cfg(not(any( + target_os = "hermit", + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") +)))] cfg_if::cfg_if! { if #[cfg(unix)] { - // On unix we'll document what's already available #[stable(feature = "rust1", since = "1.0.0")] pub use self::ext as unix_ext; - } else if #[cfg(any(target_os = "hermit", - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx")))] { - // On non-WASI wasm right now the module below doesn't compile - // (missing things in `libc` which is empty) so just omit everything - // with an empty module - #[unstable(issue = "none", feature = "std_internals")] - #[allow(missing_docs)] - pub mod unix_ext {} } else { #[path = "unix/ext/mod.rs"] pub mod unix_ext; @@ -75,23 +72,20 @@ cfg_if::cfg_if! { } #[cfg(doc)] +#[cfg(not(any( + target_os = "hermit", + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") +)))] cfg_if::cfg_if! { if #[cfg(windows)] { - // On windows we'll just be documenting what's already available #[allow(missing_docs)] #[stable(feature = "rust1", since = "1.0.0")] pub use self::ext as windows_ext; - } else if #[cfg(any(target_os = "hermit", - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx")))] { - // On non-WASI wasm right now the shim below doesn't compile, so - // just omit it - #[unstable(issue = "none", feature = "std_internals")] - #[allow(missing_docs)] - pub mod windows_ext {} } else { - // On all other platforms (aka linux/osx/etc) then pull in a "minimal" + // On non-Windows platforms (aka linux/osx/etc) pull in a "minimal" // amount of windows goop which ends up compiling + #[macro_use] #[path = "windows/compat.rs"] mod compat; @@ -105,22 +99,16 @@ cfg_if::cfg_if! { } #[cfg(doc)] +#[cfg(not(any( + target_os = "hermit", + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") +)))] cfg_if::cfg_if! { if #[cfg(target_os = "wasi")] { - // On WASI we'll document what's already available #[stable(feature = "wasi_ext_doc", since = "1.35.0")] pub use self::ext as wasi_ext; - } else if #[cfg(any(target_os = "hermit", - target_arch = "wasm32", - all(target_vendor = "fortanix", target_env = "sgx")))] { - // On non-WASI wasm right now the module below doesn't compile - // (missing things in `libc` which is empty) so just omit everything - // with an empty module - #[unstable(issue = "none", feature = "std_internals")] - #[allow(missing_docs)] - pub mod wasi_ext {} - } else { - // On other platforms like Windows document the bare bones of WASI + } else { #[path = "wasi/ext/mod.rs"] #[stable(feature = "wasi_ext_doc", since = "1.35.0")] pub mod wasi_ext; From 7024bfffbdd1fb3dafa3f263f6d10fd2aed2ff2d Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Thu, 4 Mar 2021 14:14:44 +0100 Subject: [PATCH 2/9] Move `std::sys::hermit::ext` to `std::os::hermit` --- library/std/src/{sys/hermit/ext => os/hermit}/ffi.rs | 0 library/std/src/{sys/hermit/ext => os/hermit}/mod.rs | 1 - library/std/src/os/mod.rs | 7 ++++++- library/std/src/sys/hermit/mod.rs | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) rename library/std/src/{sys/hermit/ext => os/hermit}/ffi.rs (100%) rename library/std/src/{sys/hermit/ext => os/hermit}/mod.rs (94%) diff --git a/library/std/src/sys/hermit/ext/ffi.rs b/library/std/src/os/hermit/ffi.rs similarity index 100% rename from library/std/src/sys/hermit/ext/ffi.rs rename to library/std/src/os/hermit/ffi.rs diff --git a/library/std/src/sys/hermit/ext/mod.rs b/library/std/src/os/hermit/mod.rs similarity index 94% rename from library/std/src/sys/hermit/ext/mod.rs rename to library/std/src/os/hermit/mod.rs index ea87d0ad2c94d..4657b545a1bc4 100644 --- a/library/std/src/sys/hermit/ext/mod.rs +++ b/library/std/src/os/hermit/mod.rs @@ -1,5 +1,4 @@ #![stable(feature = "rust1", since = "1.0.0")] -#![allow(missing_docs)] pub mod ffi; diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index 7e333e2b778d5..fc684f0912fa2 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -48,7 +48,12 @@ cfg_if::cfg_if! { #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] pub mod fortanix_sgx; - #[cfg(any(unix, target_os = "hermit"))] + #[cfg(target_os = "hermit")] + mod hermit; + #[cfg(target_os = "hermit")] + pub use hermit as unix; + + #[cfg(unix)] #[stable(feature = "rust1", since = "1.0.0")] pub use crate::sys::ext as unix; #[cfg(target_os = "android")] diff --git a/library/std/src/sys/hermit/mod.rs b/library/std/src/sys/hermit/mod.rs index 0c49a6fb6deff..15a76bbd2c9e0 100644 --- a/library/std/src/sys/hermit/mod.rs +++ b/library/std/src/sys/hermit/mod.rs @@ -24,7 +24,6 @@ pub mod args; pub mod cmath; pub mod condvar; pub mod env; -pub mod ext; pub mod fd; pub mod fs; #[path = "../unsupported/io.rs"] From ffc20e48de64f73ea57b6b7c121e2b50de30097f Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Thu, 4 Mar 2021 15:15:26 +0100 Subject: [PATCH 3/9] Move `std::sys::windows::ext` to `std::os::windows` --- library/std/src/os/mod.rs | 6 ++---- .../std/src/{sys/windows/ext => os/windows}/ffi.rs | 0 .../std/src/{sys/windows/ext => os/windows}/fs.rs | 0 .../std/src/{sys/windows/ext => os/windows}/io.rs | 0 .../std/src/{sys/windows/ext => os/windows}/mod.rs | 1 - .../src/{sys/windows/ext => os/windows}/process.rs | 0 .../std/src/{sys/windows/ext => os/windows}/raw.rs | 0 .../src/{sys/windows/ext => os/windows}/thread.rs | 0 library/std/src/sys/mod.rs | 13 +++---------- library/std/src/sys/windows/mod.rs | 1 - 10 files changed, 5 insertions(+), 16 deletions(-) rename library/std/src/{sys/windows/ext => os/windows}/ffi.rs (100%) rename library/std/src/{sys/windows/ext => os/windows}/fs.rs (100%) rename library/std/src/{sys/windows/ext => os/windows}/io.rs (100%) rename library/std/src/{sys/windows/ext => os/windows}/mod.rs (98%) rename library/std/src/{sys/windows/ext => os/windows}/process.rs (100%) rename library/std/src/{sys/windows/ext => os/windows}/raw.rs (100%) rename library/std/src/{sys/windows/ext => os/windows}/thread.rs (100%) diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index fc684f0912fa2..85ffe8adb1f03 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -23,8 +23,7 @@ cfg_if::cfg_if! { #[stable(feature = "wasi_ext_doc", since = "1.35.0")] pub use crate::sys::wasi_ext as wasi; - #[stable(feature = "rust1", since = "1.0.0")] - pub use crate::sys::windows_ext as windows; + pub mod windows; } else if #[cfg(doc)] { // On certain platforms right now the "main modules" modules that are // documented don't compile (missing things in `libc` which is empty), @@ -94,7 +93,6 @@ cfg_if::cfg_if! { pub mod wasi; #[cfg(windows)] - #[stable(feature = "rust1", since = "1.0.0")] - pub use crate::sys::ext as windows; + pub mod windows; } } diff --git a/library/std/src/sys/windows/ext/ffi.rs b/library/std/src/os/windows/ffi.rs similarity index 100% rename from library/std/src/sys/windows/ext/ffi.rs rename to library/std/src/os/windows/ffi.rs diff --git a/library/std/src/sys/windows/ext/fs.rs b/library/std/src/os/windows/fs.rs similarity index 100% rename from library/std/src/sys/windows/ext/fs.rs rename to library/std/src/os/windows/fs.rs diff --git a/library/std/src/sys/windows/ext/io.rs b/library/std/src/os/windows/io.rs similarity index 100% rename from library/std/src/sys/windows/ext/io.rs rename to library/std/src/os/windows/io.rs diff --git a/library/std/src/sys/windows/ext/mod.rs b/library/std/src/os/windows/mod.rs similarity index 98% rename from library/std/src/sys/windows/ext/mod.rs rename to library/std/src/os/windows/mod.rs index 613d3dc189a43..52ac508f9f707 100644 --- a/library/std/src/sys/windows/ext/mod.rs +++ b/library/std/src/os/windows/mod.rs @@ -8,7 +8,6 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(cfg(windows))] -#![allow(missing_docs)] pub mod ffi; pub mod fs; diff --git a/library/std/src/sys/windows/ext/process.rs b/library/std/src/os/windows/process.rs similarity index 100% rename from library/std/src/sys/windows/ext/process.rs rename to library/std/src/os/windows/process.rs diff --git a/library/std/src/sys/windows/ext/raw.rs b/library/std/src/os/windows/raw.rs similarity index 100% rename from library/std/src/sys/windows/ext/raw.rs rename to library/std/src/os/windows/raw.rs diff --git a/library/std/src/sys/windows/ext/thread.rs b/library/std/src/os/windows/thread.rs similarity index 100% rename from library/std/src/sys/windows/ext/thread.rs rename to library/std/src/os/windows/thread.rs diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index 33e68d12b0a3d..6b38f62dfe508 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -78,23 +78,16 @@ cfg_if::cfg_if! { all(target_vendor = "fortanix", target_env = "sgx") )))] cfg_if::cfg_if! { - if #[cfg(windows)] { - #[allow(missing_docs)] - #[stable(feature = "rust1", since = "1.0.0")] - pub use self::ext as windows_ext; - } else { + if #[cfg(not(windows))] { // On non-Windows platforms (aka linux/osx/etc) pull in a "minimal" // amount of windows goop which ends up compiling #[macro_use] #[path = "windows/compat.rs"] - mod compat; + pub mod compat; #[path = "windows/c.rs"] - mod c; - - #[path = "windows/ext/mod.rs"] - pub mod windows_ext; + pub mod c; } } diff --git a/library/std/src/sys/windows/mod.rs b/library/std/src/sys/windows/mod.rs index 2208ff025c0f7..cc60ca375ea39 100644 --- a/library/std/src/sys/windows/mod.rs +++ b/library/std/src/sys/windows/mod.rs @@ -18,7 +18,6 @@ pub mod c; pub mod cmath; pub mod condvar; pub mod env; -pub mod ext; pub mod fs; pub mod handle; pub mod io; From a808fd44a331912b1fef05d2bfdce69809857133 Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Thu, 4 Mar 2021 15:26:41 +0100 Subject: [PATCH 4/9] Move `std::sys::unix::ext` to `std::os::unix` --- library/std/src/os/mod.rs | 6 ++---- library/std/src/{sys/unix/ext => os/unix}/ffi.rs | 0 library/std/src/{sys/unix/ext => os/unix}/fs.rs | 0 library/std/src/{sys/unix/ext => os/unix}/io.rs | 0 library/std/src/{sys/unix/ext => os/unix}/mod.rs | 1 - .../src/{sys/unix/ext => os/unix}/net/addr.rs | 0 .../{sys/unix/ext => os/unix}/net/ancillary.rs | 0 .../{sys/unix/ext => os/unix}/net/datagram.rs | 0 .../{sys/unix/ext => os/unix}/net/listener.rs | 0 .../std/src/{sys/unix/ext => os/unix}/net/mod.rs | 0 .../src/{sys/unix/ext => os/unix}/net/raw_fd.rs | 0 .../src/{sys/unix/ext => os/unix}/net/stream.rs | 0 .../src/{sys/unix/ext => os/unix}/net/tests.rs | 0 .../std/src/{sys/unix/ext => os/unix}/process.rs | 0 library/std/src/{sys/unix/ext => os/unix}/raw.rs | 0 .../std/src/{sys/unix/ext => os/unix}/thread.rs | 0 .../std/src/{sys/unix/ext => os/unix}/ucred.rs | 0 .../src/{sys/unix/ext => os/unix}/ucred/tests.rs | 0 library/std/src/sys/mod.rs | 16 ---------------- library/std/src/sys/unix/mod.rs | 1 - 20 files changed, 2 insertions(+), 22 deletions(-) rename library/std/src/{sys/unix/ext => os/unix}/ffi.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/fs.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/io.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/mod.rs (99%) rename library/std/src/{sys/unix/ext => os/unix}/net/addr.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/net/ancillary.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/net/datagram.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/net/listener.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/net/mod.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/net/raw_fd.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/net/stream.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/net/tests.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/process.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/raw.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/thread.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/ucred.rs (100%) rename library/std/src/{sys/unix/ext => os/unix}/ucred/tests.rs (100%) diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index 85ffe8adb1f03..abc29a138c87b 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -15,8 +15,7 @@ cfg_if::cfg_if! { // This should help show platform-specific functionality in a hopefully cross-platform // way in the documentation. - #[stable(feature = "rust1", since = "1.0.0")] - pub use crate::sys::unix_ext as unix; + pub mod unix; pub mod linux; @@ -53,8 +52,7 @@ cfg_if::cfg_if! { pub use hermit as unix; #[cfg(unix)] - #[stable(feature = "rust1", since = "1.0.0")] - pub use crate::sys::ext as unix; + pub mod unix; #[cfg(target_os = "android")] pub mod android; #[cfg(target_os = "dragonfly")] diff --git a/library/std/src/sys/unix/ext/ffi.rs b/library/std/src/os/unix/ffi.rs similarity index 100% rename from library/std/src/sys/unix/ext/ffi.rs rename to library/std/src/os/unix/ffi.rs diff --git a/library/std/src/sys/unix/ext/fs.rs b/library/std/src/os/unix/fs.rs similarity index 100% rename from library/std/src/sys/unix/ext/fs.rs rename to library/std/src/os/unix/fs.rs diff --git a/library/std/src/sys/unix/ext/io.rs b/library/std/src/os/unix/io.rs similarity index 100% rename from library/std/src/sys/unix/ext/io.rs rename to library/std/src/os/unix/io.rs diff --git a/library/std/src/sys/unix/ext/mod.rs b/library/std/src/os/unix/mod.rs similarity index 99% rename from library/std/src/sys/unix/ext/mod.rs rename to library/std/src/os/unix/mod.rs index 735bf35a3ced6..a93ed333cecb9 100644 --- a/library/std/src/sys/unix/ext/mod.rs +++ b/library/std/src/os/unix/mod.rs @@ -27,7 +27,6 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(cfg(unix))] -#![allow(missing_docs)] cfg_if::cfg_if! { if #[cfg(doc)] { diff --git a/library/std/src/sys/unix/ext/net/addr.rs b/library/std/src/os/unix/net/addr.rs similarity index 100% rename from library/std/src/sys/unix/ext/net/addr.rs rename to library/std/src/os/unix/net/addr.rs diff --git a/library/std/src/sys/unix/ext/net/ancillary.rs b/library/std/src/os/unix/net/ancillary.rs similarity index 100% rename from library/std/src/sys/unix/ext/net/ancillary.rs rename to library/std/src/os/unix/net/ancillary.rs diff --git a/library/std/src/sys/unix/ext/net/datagram.rs b/library/std/src/os/unix/net/datagram.rs similarity index 100% rename from library/std/src/sys/unix/ext/net/datagram.rs rename to library/std/src/os/unix/net/datagram.rs diff --git a/library/std/src/sys/unix/ext/net/listener.rs b/library/std/src/os/unix/net/listener.rs similarity index 100% rename from library/std/src/sys/unix/ext/net/listener.rs rename to library/std/src/os/unix/net/listener.rs diff --git a/library/std/src/sys/unix/ext/net/mod.rs b/library/std/src/os/unix/net/mod.rs similarity index 100% rename from library/std/src/sys/unix/ext/net/mod.rs rename to library/std/src/os/unix/net/mod.rs diff --git a/library/std/src/sys/unix/ext/net/raw_fd.rs b/library/std/src/os/unix/net/raw_fd.rs similarity index 100% rename from library/std/src/sys/unix/ext/net/raw_fd.rs rename to library/std/src/os/unix/net/raw_fd.rs diff --git a/library/std/src/sys/unix/ext/net/stream.rs b/library/std/src/os/unix/net/stream.rs similarity index 100% rename from library/std/src/sys/unix/ext/net/stream.rs rename to library/std/src/os/unix/net/stream.rs diff --git a/library/std/src/sys/unix/ext/net/tests.rs b/library/std/src/os/unix/net/tests.rs similarity index 100% rename from library/std/src/sys/unix/ext/net/tests.rs rename to library/std/src/os/unix/net/tests.rs diff --git a/library/std/src/sys/unix/ext/process.rs b/library/std/src/os/unix/process.rs similarity index 100% rename from library/std/src/sys/unix/ext/process.rs rename to library/std/src/os/unix/process.rs diff --git a/library/std/src/sys/unix/ext/raw.rs b/library/std/src/os/unix/raw.rs similarity index 100% rename from library/std/src/sys/unix/ext/raw.rs rename to library/std/src/os/unix/raw.rs diff --git a/library/std/src/sys/unix/ext/thread.rs b/library/std/src/os/unix/thread.rs similarity index 100% rename from library/std/src/sys/unix/ext/thread.rs rename to library/std/src/os/unix/thread.rs diff --git a/library/std/src/sys/unix/ext/ucred.rs b/library/std/src/os/unix/ucred.rs similarity index 100% rename from library/std/src/sys/unix/ext/ucred.rs rename to library/std/src/os/unix/ucred.rs diff --git a/library/std/src/sys/unix/ext/ucred/tests.rs b/library/std/src/os/unix/ucred/tests.rs similarity index 100% rename from library/std/src/sys/unix/ext/ucred/tests.rs rename to library/std/src/os/unix/ucred/tests.rs diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index 6b38f62dfe508..9906d5c4985ba 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -55,22 +55,6 @@ cfg_if::cfg_if! { // (missing things in `libc` which is empty), so they are not included in `std::os` and can be // omitted here as well. -#[cfg(doc)] -#[cfg(not(any( - target_os = "hermit", - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx") -)))] -cfg_if::cfg_if! { - if #[cfg(unix)] { - #[stable(feature = "rust1", since = "1.0.0")] - pub use self::ext as unix_ext; - } else { - #[path = "unix/ext/mod.rs"] - pub mod unix_ext; - } -} - #[cfg(doc)] #[cfg(not(any( target_os = "hermit", diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 562d9d92637a6..57d91441b6fc3 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -15,7 +15,6 @@ pub mod args; pub mod cmath; pub mod condvar; pub mod env; -pub mod ext; pub mod fd; pub mod fs; pub mod futex; From 3edba7a806c2bb2ca78aec23baf1251eafe52c92 Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Thu, 4 Mar 2021 15:39:31 +0100 Subject: [PATCH 5/9] Move `std::sys::wasi::ext` to `std::os::wasi` --- library/std/src/os/mod.rs | 3 +-- library/std/src/os/wasi.rs | 6 ------ .../std/src/{sys/wasi/ext => os/wasi}/ffi.rs | 0 library/std/src/{sys/wasi/ext => os/wasi}/fs.rs | 0 library/std/src/{sys/wasi/ext => os/wasi}/io.rs | 0 .../std/src/{sys/wasi/ext => os/wasi}/mod.rs | 1 + library/std/src/sys/mod.rs | 17 ----------------- library/std/src/sys/wasi/mod.rs | 1 - 8 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 library/std/src/os/wasi.rs rename library/std/src/{sys/wasi/ext => os/wasi}/ffi.rs (100%) rename library/std/src/{sys/wasi/ext => os/wasi}/fs.rs (100%) rename library/std/src/{sys/wasi/ext => os/wasi}/io.rs (100%) rename library/std/src/{sys/wasi/ext => os/wasi}/mod.rs (97%) diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index abc29a138c87b..ecaa25cf8005a 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -19,8 +19,7 @@ cfg_if::cfg_if! { pub mod linux; - #[stable(feature = "wasi_ext_doc", since = "1.35.0")] - pub use crate::sys::wasi_ext as wasi; + pub mod wasi; pub mod windows; } else if #[cfg(doc)] { diff --git a/library/std/src/os/wasi.rs b/library/std/src/os/wasi.rs deleted file mode 100644 index d25b8d39ed680..0000000000000 --- a/library/std/src/os/wasi.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! WASI-specific definitions - -#![stable(feature = "raw_ext", since = "1.1.0")] - -#[stable(feature = "rust1", since = "1.0.0")] -pub use crate::sys::ext::*; diff --git a/library/std/src/sys/wasi/ext/ffi.rs b/library/std/src/os/wasi/ffi.rs similarity index 100% rename from library/std/src/sys/wasi/ext/ffi.rs rename to library/std/src/os/wasi/ffi.rs diff --git a/library/std/src/sys/wasi/ext/fs.rs b/library/std/src/os/wasi/fs.rs similarity index 100% rename from library/std/src/sys/wasi/ext/fs.rs rename to library/std/src/os/wasi/fs.rs diff --git a/library/std/src/sys/wasi/ext/io.rs b/library/std/src/os/wasi/io.rs similarity index 100% rename from library/std/src/sys/wasi/ext/io.rs rename to library/std/src/os/wasi/io.rs diff --git a/library/std/src/sys/wasi/ext/mod.rs b/library/std/src/os/wasi/mod.rs similarity index 97% rename from library/std/src/sys/wasi/ext/mod.rs rename to library/std/src/os/wasi/mod.rs index b08402f077652..66edb953677b3 100644 --- a/library/std/src/sys/wasi/ext/mod.rs +++ b/library/std/src/os/wasi/mod.rs @@ -25,6 +25,7 @@ //! } //! ``` +#![stable(feature = "rust1", since = "1.0.0")] #![deny(unsafe_op_in_unsafe_fn)] #![doc(cfg(target_os = "wasi"))] diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index 9906d5c4985ba..ac217db2eb344 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -74,20 +74,3 @@ cfg_if::cfg_if! { pub mod c; } } - -#[cfg(doc)] -#[cfg(not(any( - target_os = "hermit", - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx") -)))] -cfg_if::cfg_if! { - if #[cfg(target_os = "wasi")] { - #[stable(feature = "wasi_ext_doc", since = "1.35.0")] - pub use self::ext as wasi_ext; - } else { - #[path = "wasi/ext/mod.rs"] - #[stable(feature = "wasi_ext_doc", since = "1.35.0")] - pub mod wasi_ext; - } -} diff --git a/library/std/src/sys/wasi/mod.rs b/library/std/src/sys/wasi/mod.rs index 88b81d455d241..45a829c0cd212 100644 --- a/library/std/src/sys/wasi/mod.rs +++ b/library/std/src/sys/wasi/mod.rs @@ -33,7 +33,6 @@ pub mod mutex; pub mod net; pub mod os; pub use crate::sys_common::os_str_bytes as os_str; -pub mod ext; #[path = "../unix/path.rs"] pub mod path; #[path = "../unsupported/pipe.rs"] From e098d2730abfe7210599998d43e2af3be72c74fc Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Thu, 4 Mar 2021 15:45:27 +0100 Subject: [PATCH 6/9] Move `std::sys::sgx::ext` to `std::os::fortanix_sgx` --- library/std/src/{sys/sgx/ext => os/fortanix_sgx}/arch.rs | 0 library/std/src/{sys/sgx/ext => os/fortanix_sgx}/ffi.rs | 0 library/std/src/{sys/sgx/ext => os/fortanix_sgx}/io.rs | 0 library/std/src/os/fortanix_sgx/mod.rs | 6 ++++-- library/std/src/sys/sgx/ext/mod.rs | 5 ----- library/std/src/sys/sgx/mod.rs | 1 - 6 files changed, 4 insertions(+), 8 deletions(-) rename library/std/src/{sys/sgx/ext => os/fortanix_sgx}/arch.rs (100%) rename library/std/src/{sys/sgx/ext => os/fortanix_sgx}/ffi.rs (100%) rename library/std/src/{sys/sgx/ext => os/fortanix_sgx}/io.rs (100%) delete mode 100644 library/std/src/sys/sgx/ext/mod.rs diff --git a/library/std/src/sys/sgx/ext/arch.rs b/library/std/src/os/fortanix_sgx/arch.rs similarity index 100% rename from library/std/src/sys/sgx/ext/arch.rs rename to library/std/src/os/fortanix_sgx/arch.rs diff --git a/library/std/src/sys/sgx/ext/ffi.rs b/library/std/src/os/fortanix_sgx/ffi.rs similarity index 100% rename from library/std/src/sys/sgx/ext/ffi.rs rename to library/std/src/os/fortanix_sgx/ffi.rs diff --git a/library/std/src/sys/sgx/ext/io.rs b/library/std/src/os/fortanix_sgx/io.rs similarity index 100% rename from library/std/src/sys/sgx/ext/io.rs rename to library/std/src/os/fortanix_sgx/io.rs diff --git a/library/std/src/os/fortanix_sgx/mod.rs b/library/std/src/os/fortanix_sgx/mod.rs index 69923268e570e..a40dabe190ae0 100644 --- a/library/std/src/os/fortanix_sgx/mod.rs +++ b/library/std/src/os/fortanix_sgx/mod.rs @@ -3,7 +3,7 @@ //! This includes functions to deal with memory isolation, usercalls, and the //! SGX instruction set. -#![deny(missing_docs, missing_debug_implementations)] +#![deny(missing_docs)] #![unstable(feature = "sgx_platform", issue = "56975")] /// Low-level interfaces to usercalls. See the [ABI documentation] for more @@ -43,7 +43,9 @@ pub mod mem { pub use crate::sys::abi::mem::*; } -pub use crate::sys::ext::{arch, ffi, io}; +pub mod arch; +pub mod ffi; +pub mod io; /// Functions for querying thread-related information. pub mod thread { diff --git a/library/std/src/sys/sgx/ext/mod.rs b/library/std/src/sys/sgx/ext/mod.rs deleted file mode 100644 index 258ad3cd2180c..0000000000000 --- a/library/std/src/sys/sgx/ext/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![unstable(feature = "sgx_platform", issue = "56975")] - -pub mod arch; -pub mod ffi; -pub mod io; diff --git a/library/std/src/sys/sgx/mod.rs b/library/std/src/sys/sgx/mod.rs index bf3bd57e98255..cdfceca19fcdc 100644 --- a/library/std/src/sys/sgx/mod.rs +++ b/library/std/src/sys/sgx/mod.rs @@ -17,7 +17,6 @@ pub mod args; pub mod cmath; pub mod condvar; pub mod env; -pub mod ext; pub mod fd; #[path = "../unsupported/fs.rs"] pub mod fs; From a0ca3f94f00fb8772ac9b89333d98e668375163b Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Wed, 14 Apr 2021 21:36:13 +0200 Subject: [PATCH 7/9] Rework `os` to avoid using `cfg_if!` with public items --- library/std/src/os/mod.rs | 202 +++++++++++++++++++-------------- library/std/src/os/unix/mod.rs | 72 ++++++------ 2 files changed, 151 insertions(+), 123 deletions(-) diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index ecaa25cf8005a..4365966e7289e 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -5,91 +5,119 @@ pub mod raw; -cfg_if::cfg_if! { - if #[cfg(all(doc, not(any(target_os = "hermit", - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx")))))]{ - // When documenting std we want to show the `unix`, `windows`, `linux` and `wasi` - // modules as these are the "main modules" that are used across platforms, - // so these modules are enabled when `cfg(doc)` is set. - // This should help show platform-specific functionality in a hopefully cross-platform - // way in the documentation. - - pub mod unix; - - pub mod linux; - - pub mod wasi; - - pub mod windows; - } else if #[cfg(doc)] { - // On certain platforms right now the "main modules" modules that are - // documented don't compile (missing things in `libc` which is empty), - // so just omit them with an empty module. - - #[unstable(issue = "none", feature = "std_internals")] - pub mod unix {} - - #[unstable(issue = "none", feature = "std_internals")] - pub mod linux {} - - #[unstable(issue = "none", feature = "std_internals")] - pub mod wasi {} - - #[unstable(issue = "none", feature = "std_internals")] - pub mod windows {} - } else { - // If we're not documenting std then we only expose modules appropriate for the - // current platform. - - #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] - pub mod fortanix_sgx; - - #[cfg(target_os = "hermit")] - mod hermit; - #[cfg(target_os = "hermit")] - pub use hermit as unix; - - #[cfg(unix)] - pub mod unix; - #[cfg(target_os = "android")] - pub mod android; - #[cfg(target_os = "dragonfly")] - pub mod dragonfly; - #[cfg(target_os = "emscripten")] - pub mod emscripten; - #[cfg(target_os = "freebsd")] - pub mod freebsd; - #[cfg(target_os = "fuchsia")] - pub mod fuchsia; - #[cfg(target_os = "haiku")] - pub mod haiku; - #[cfg(target_os = "illumos")] - pub mod illumos; - #[cfg(target_os = "ios")] - pub mod ios; - #[cfg(target_os = "l4re")] - pub mod linux; - #[cfg(target_os = "linux")] - pub mod linux; - #[cfg(target_os = "macos")] - pub mod macos; - #[cfg(target_os = "netbsd")] - pub mod netbsd; - #[cfg(target_os = "openbsd")] - pub mod openbsd; - #[cfg(target_os = "redox")] - pub mod redox; - #[cfg(target_os = "solaris")] - pub mod solaris; - - #[cfg(target_os = "vxworks")] - pub mod vxworks; - - #[cfg(target_os = "wasi")] - pub mod wasi; - - #[cfg(windows)] - pub mod windows; - } +// The code below could be written clearer using `cfg_if!`. However, the items below are +// publicly exported by `std` and external tools can have trouble analysing them because of the use +// of a macro that is not vendored by Rust and included in the toolchain. +// See https://github.com/rust-analyzer/rust-analyzer/issues/6038. + +#[cfg(all( + doc, + not(any( + target_os = "hermit", + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") + )) +))] +#[path = "."] +mod doc { + // When documenting std we want to show the `unix`, `windows`, `linux` and `wasi` + // modules as these are the "main modules" that are used across platforms, + // so these modules are enabled when `cfg(doc)` is set. + // This should help show platform-specific functionality in a hopefully cross-platform + // way in the documentation. + + pub mod unix; + + pub mod linux; + + pub mod wasi; + + pub mod windows; } +#[cfg(all( + doc, + any( + target_os = "hermit", + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") + ) +))] +mod doc { + // On certain platforms right now the "main modules" modules that are + // documented don't compile (missing things in `libc` which is empty), + // so just omit them with an empty module. + + #[unstable(issue = "none", feature = "std_internals")] + pub mod unix {} + + #[unstable(issue = "none", feature = "std_internals")] + pub mod linux {} + + #[unstable(issue = "none", feature = "std_internals")] + pub mod wasi {} + + #[unstable(issue = "none", feature = "std_internals")] + pub mod windows {} +} +#[cfg(doc)] +#[stable(feature = "os", since = "1.0.0")] +pub use doc::*; + +#[cfg(not(doc))] +#[path = "."] +mod imp { + // If we're not documenting std then we only expose modules appropriate for the + // current platform. + + #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] + pub mod fortanix_sgx; + + #[cfg(target_os = "hermit")] + #[path = "hermit/mod.rs"] + pub mod unix; + + #[cfg(target_os = "android")] + pub mod android; + #[cfg(target_os = "dragonfly")] + pub mod dragonfly; + #[cfg(target_os = "emscripten")] + pub mod emscripten; + #[cfg(target_os = "freebsd")] + pub mod freebsd; + #[cfg(target_os = "fuchsia")] + pub mod fuchsia; + #[cfg(target_os = "haiku")] + pub mod haiku; + #[cfg(target_os = "illumos")] + pub mod illumos; + #[cfg(target_os = "ios")] + pub mod ios; + #[cfg(target_os = "l4re")] + pub mod linux; + #[cfg(target_os = "linux")] + pub mod linux; + #[cfg(target_os = "macos")] + pub mod macos; + #[cfg(target_os = "netbsd")] + pub mod netbsd; + #[cfg(target_os = "openbsd")] + pub mod openbsd; + #[cfg(target_os = "redox")] + pub mod redox; + #[cfg(target_os = "solaris")] + pub mod solaris; + #[cfg(unix)] + pub mod unix; + + #[cfg(target_os = "vxworks")] + pub mod vxworks; + + #[cfg(target_os = "wasi")] + pub mod wasi; + + #[cfg(windows)] + pub mod windows; +} +#[cfg(not(doc))] +#[stable(feature = "os", since = "1.0.0")] +pub use imp::*; diff --git a/library/std/src/os/unix/mod.rs b/library/std/src/os/unix/mod.rs index a93ed333cecb9..6fc1c89a2ba80 100644 --- a/library/std/src/os/unix/mod.rs +++ b/library/std/src/os/unix/mod.rs @@ -28,42 +28,42 @@ #![stable(feature = "rust1", since = "1.0.0")] #![doc(cfg(unix))] -cfg_if::cfg_if! { - if #[cfg(doc)] { - // Use linux as the default platform when documenting on other platforms like Windows - use crate::os::linux as platform; - } else { - #[cfg(target_os = "android")] - use crate::os::android as platform; - #[cfg(target_os = "dragonfly")] - use crate::os::dragonfly as platform; - #[cfg(target_os = "emscripten")] - use crate::os::emscripten as platform; - #[cfg(target_os = "freebsd")] - use crate::os::freebsd as platform; - #[cfg(target_os = "fuchsia")] - use crate::os::fuchsia as platform; - #[cfg(target_os = "haiku")] - use crate::os::haiku as platform; - #[cfg(target_os = "illumos")] - use crate::os::illumos as platform; - #[cfg(target_os = "ios")] - use crate::os::ios as platform; - #[cfg(any(target_os = "linux", target_os = "l4re"))] - use crate::os::linux as platform; - #[cfg(target_os = "macos")] - use crate::os::macos as platform; - #[cfg(target_os = "netbsd")] - use crate::os::netbsd as platform; - #[cfg(target_os = "openbsd")] - use crate::os::openbsd as platform; - #[cfg(target_os = "redox")] - use crate::os::redox as platform; - #[cfg(target_os = "solaris")] - use crate::os::solaris as platform; - #[cfg(target_os = "vxworks")] - use crate::os::vxworks as platform; - } +// Use linux as the default platform when documenting on other platforms like Windows +#[cfg(doc)] +use crate::os::linux as platform; + +#[cfg(not(doc))] +mod platform { + #[cfg(target_os = "android")] + pub use crate::os::android::*; + #[cfg(target_os = "dragonfly")] + pub use crate::os::dragonfly::*; + #[cfg(target_os = "emscripten")] + pub use crate::os::emscripten::*; + #[cfg(target_os = "freebsd")] + pub use crate::os::freebsd::*; + #[cfg(target_os = "fuchsia")] + pub use crate::os::fuchsia::*; + #[cfg(target_os = "haiku")] + pub use crate::os::haiku::*; + #[cfg(target_os = "illumos")] + pub use crate::os::illumos::*; + #[cfg(target_os = "ios")] + pub use crate::os::ios::*; + #[cfg(any(target_os = "linux", target_os = "l4re"))] + pub use crate::os::linux::*; + #[cfg(target_os = "macos")] + pub use crate::os::macos::*; + #[cfg(target_os = "netbsd")] + pub use crate::os::netbsd::*; + #[cfg(target_os = "openbsd")] + pub use crate::os::openbsd::*; + #[cfg(target_os = "redox")] + pub use crate::os::redox::*; + #[cfg(target_os = "solaris")] + pub use crate::os::solaris::*; + #[cfg(target_os = "vxworks")] + pub use crate::os::vxworks::*; } pub mod ffi; From 0caa20ee5d97861d98b5458bc0f99468111d39e3 Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Sun, 18 Apr 2021 04:16:02 +0200 Subject: [PATCH 8/9] Allow documenting on `hermit` --- library/std/src/os/mod.rs | 2 -- library/std/src/sys/mod.rs | 1 - 2 files changed, 3 deletions(-) diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index 4365966e7289e..07e29ebf3681c 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -13,7 +13,6 @@ pub mod raw; #[cfg(all( doc, not(any( - target_os = "hermit", all(target_arch = "wasm32", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") )) @@ -37,7 +36,6 @@ mod doc { #[cfg(all( doc, any( - target_os = "hermit", all(target_arch = "wasm32", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") ) diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index ac217db2eb344..f813587b1b340 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -57,7 +57,6 @@ cfg_if::cfg_if! { #[cfg(doc)] #[cfg(not(any( - target_os = "hermit", all(target_arch = "wasm32", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") )))] From 2173d8dbe67790e0054876de99fcbfafdb4f8ecd Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Sun, 25 Apr 2021 13:10:19 +0200 Subject: [PATCH 9/9] Change `std::sys::unix::ext::fs::PermissionsExt::from_mode` to `std::os::imp::unix::fs::PermissionsExt::from_mode` in Clippy --- src/tools/clippy/clippy_utils/src/paths.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/clippy/clippy_utils/src/paths.rs b/src/tools/clippy/clippy_utils/src/paths.rs index 5e6733a300f2c..1fa439639b24a 100644 --- a/src/tools/clippy/clippy_utils/src/paths.rs +++ b/src/tools/clippy/clippy_utils/src/paths.rs @@ -101,7 +101,7 @@ pub const PARKING_LOT_RWLOCK_WRITE_GUARD: [&str; 2] = ["parking_lot", "RwLockWri pub const PATH_BUF_AS_PATH: [&str; 4] = ["std", "path", "PathBuf", "as_path"]; pub const PATH_TO_PATH_BUF: [&str; 4] = ["std", "path", "Path", "to_path_buf"]; pub const PERMISSIONS: [&str; 3] = ["std", "fs", "Permissions"]; -pub const PERMISSIONS_FROM_MODE: [&str; 7] = ["std", "sys", "unix", "ext", "fs", "PermissionsExt", "from_mode"]; +pub const PERMISSIONS_FROM_MODE: [&str; 7] = ["std", "os", "imp", "unix", "fs", "PermissionsExt", "from_mode"]; pub const POLL: [&str; 4] = ["core", "task", "poll", "Poll"]; pub const POLL_PENDING: [&str; 5] = ["core", "task", "poll", "Poll", "Pending"]; pub const POLL_READY: [&str; 5] = ["core", "task", "poll", "Poll", "Ready"];