From b98ba6f190c219b79de07477b0c6d74072678799 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 7 Sep 2021 15:44:08 +0200 Subject: [PATCH] Move fortanix module position in std::os reexports for alpha sort --- library/std/src/os/mod.rs | 54 ++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index 3f02a650e3541..069a5376a441c 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -14,9 +14,6 @@ pub mod raw; // documented don't compile (missing things in `libc` which is empty), // so just omit them with an empty module and add the "unstable" attribute. -#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] -pub mod fortanix_sgx; - // Unix, linux, wasi and windows are handled a bit differently. #[cfg(all( doc, @@ -56,40 +53,55 @@ pub mod wasi {} pub mod windows {} // unix -#[cfg(not(any( - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx") +#[cfg(not(all( + doc, + any( + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") + ) )))] -#[cfg(all(not(doc), target_os = "hermit"))] +#[cfg(target_os = "hermit")] #[path = "hermit/mod.rs"] pub mod unix; -#[cfg(not(any( - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx") +#[cfg(not(all( + doc, + any( + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") + ) )))] -#[cfg(any(unix, doc))] +#[cfg(all(not(target_os = "hermit"), any(unix, doc)))] pub mod unix; // linux -#[cfg(not(any( - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx") +#[cfg(not(all( + doc, + any( + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") + ) )))] #[cfg(any(target_os = "linux", target_os = "l4re", doc))] pub mod linux; // wasi -#[cfg(not(any( - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx") +#[cfg(not(all( + doc, + any( + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") + ) )))] #[cfg(any(target_os = "wasi", doc))] pub mod wasi; // windows -#[cfg(not(any( - all(target_arch = "wasm32", not(target_os = "wasi")), - all(target_vendor = "fortanix", target_env = "sgx") +#[cfg(not(all( + doc, + any( + all(target_arch = "wasm32", not(target_os = "wasi")), + all(target_vendor = "fortanix", target_env = "sgx") + ) )))] #[cfg(any(windows, doc))] pub mod windows; @@ -103,6 +115,8 @@ pub mod dragonfly; pub mod emscripten; #[cfg(target_os = "espidf")] pub mod espidf; +#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] +pub mod fortanix_sgx; #[cfg(target_os = "freebsd")] pub mod freebsd; #[cfg(target_os = "fuchsia")]