about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/env.rs2
-rw-r--r--library/std/src/sys/env_consts.rs (renamed from library/std/src/sys/pal/unix/env.rs)70
-rw-r--r--library/std/src/sys/mod.rs1
-rw-r--r--library/std/src/sys/pal/hermit/env.rs9
-rw-r--r--library/std/src/sys/pal/hermit/mod.rs1
-rw-r--r--library/std/src/sys/pal/sgx/env.rs9
-rw-r--r--library/std/src/sys/pal/sgx/mod.rs1
-rw-r--r--library/std/src/sys/pal/solid/env.rs9
-rw-r--r--library/std/src/sys/pal/solid/mod.rs1
-rw-r--r--library/std/src/sys/pal/teeos/mod.rs3
-rw-r--r--library/std/src/sys/pal/trusty/mod.rs2
-rw-r--r--library/std/src/sys/pal/uefi/env.rs9
-rw-r--r--library/std/src/sys/pal/uefi/mod.rs1
-rw-r--r--library/std/src/sys/pal/unix/mod.rs1
-rw-r--r--library/std/src/sys/pal/unsupported/env.rs9
-rw-r--r--library/std/src/sys/pal/unsupported/mod.rs1
-rw-r--r--library/std/src/sys/pal/wasi/env.rs11
-rw-r--r--library/std/src/sys/pal/wasi/mod.rs1
-rw-r--r--library/std/src/sys/pal/wasip2/mod.rs2
-rw-r--r--library/std/src/sys/pal/wasm/env.rs9
-rw-r--r--library/std/src/sys/pal/wasm/mod.rs1
-rw-r--r--library/std/src/sys/pal/windows/env.rs9
-rw-r--r--library/std/src/sys/pal/windows/mod.rs1
-rw-r--r--library/std/src/sys/pal/xous/mod.rs2
-rw-r--r--library/std/src/sys/pal/zkvm/mod.rs1
25 files changed, 71 insertions, 95 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index 05bd4345ea8..c84a72c4fad 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -950,7 +950,7 @@ impl fmt::Debug for ArgsOs {
 /// Constants associated with the current target
 #[stable(feature = "env", since = "1.0.0")]
 pub mod consts {
-    use crate::sys::env::os;
+    use crate::sys::env_consts::os;
 
     /// A string describing the architecture of the CPU that is currently in use.
     /// An example value may be: `"x86"`, `"arm"` or `"riscv64"`.
diff --git a/library/std/src/sys/pal/unix/env.rs b/library/std/src/sys/env_consts.rs
index 1a5e23f06b8..f439aa5a905 100644
--- a/library/std/src/sys/pal/unix/env.rs
+++ b/library/std/src/sys/env_consts.rs
@@ -1,3 +1,5 @@
+//! Constants associated with each target.
+
 // Keep entries sorted alphabetically.
 
 #[cfg(target_os = "aix")]
@@ -44,7 +46,7 @@ pub mod os {
     pub const EXE_EXTENSION: &str = "";
 }
 
-#[cfg(all(target_os = "emscripten", target_arch = "wasm32"))]
+#[cfg(target_os = "emscripten")]
 pub mod os {
     pub const FAMILY: &str = "unix";
     pub const OS: &str = "emscripten";
@@ -99,6 +101,17 @@ pub mod os {
     pub const EXE_EXTENSION: &str = "";
 }
 
+#[cfg(target_os = "hermit")]
+pub mod os {
+    pub const FAMILY: &str = "";
+    pub const OS: &str = "hermit";
+    pub const DLL_PREFIX: &str = "";
+    pub const DLL_SUFFIX: &str = "";
+    pub const DLL_EXTENSION: &str = "";
+    pub const EXE_SUFFIX: &str = "";
+    pub const EXE_EXTENSION: &str = "";
+}
+
 #[cfg(target_os = "horizon")]
 pub mod os {
     pub const FAMILY: &str = "unix";
@@ -242,6 +255,17 @@ pub mod os {
     pub const EXE_EXTENSION: &str = "";
 }
 
+#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
+pub mod os {
+    pub const FAMILY: &str = "";
+    pub const OS: &str = "";
+    pub const DLL_PREFIX: &str = "";
+    pub const DLL_SUFFIX: &str = ".sgxs";
+    pub const DLL_EXTENSION: &str = "sgxs";
+    pub const EXE_SUFFIX: &str = ".sgxs";
+    pub const EXE_EXTENSION: &str = "sgxs";
+}
+
 #[cfg(target_os = "solaris")]
 pub mod os {
     pub const FAMILY: &str = "unix";
@@ -253,6 +277,17 @@ pub mod os {
     pub const EXE_EXTENSION: &str = "";
 }
 
+#[cfg(target_os = "solid_asp3")]
+pub mod os {
+    pub const FAMILY: &str = "itron";
+    pub const OS: &str = "solid";
+    pub const DLL_PREFIX: &str = "";
+    pub const DLL_SUFFIX: &str = ".so";
+    pub const DLL_EXTENSION: &str = "so";
+    pub const EXE_SUFFIX: &str = "";
+    pub const EXE_EXTENSION: &str = "";
+}
+
 #[cfg(target_os = "tvos")]
 pub mod os {
     pub const FAMILY: &str = "unix";
@@ -264,6 +299,17 @@ pub mod os {
     pub const EXE_EXTENSION: &str = "";
 }
 
+#[cfg(target_os = "uefi")]
+pub mod os {
+    pub const FAMILY: &str = "";
+    pub const OS: &str = "uefi";
+    pub const DLL_PREFIX: &str = "";
+    pub const DLL_SUFFIX: &str = "";
+    pub const DLL_EXTENSION: &str = "";
+    pub const EXE_SUFFIX: &str = ".efi";
+    pub const EXE_EXTENSION: &str = "efi";
+}
+
 #[cfg(target_os = "visionos")]
 pub mod os {
     pub const FAMILY: &str = "unix";
@@ -297,6 +343,17 @@ pub mod os {
     pub const EXE_EXTENSION: &str = "";
 }
 
+#[cfg(all(target_family = "wasm", not(any(target_os = "emscripten", target_os = "linux"))))]
+pub mod os {
+    pub const FAMILY: &str = "";
+    pub const OS: &str = "";
+    pub const DLL_PREFIX: &str = "";
+    pub const DLL_SUFFIX: &str = ".wasm";
+    pub const DLL_EXTENSION: &str = "wasm";
+    pub const EXE_SUFFIX: &str = ".wasm";
+    pub const EXE_EXTENSION: &str = "wasm";
+}
+
 #[cfg(target_os = "watchos")]
 pub mod os {
     pub const FAMILY: &str = "unix";
@@ -307,3 +364,14 @@ pub mod os {
     pub const EXE_SUFFIX: &str = "";
     pub const EXE_EXTENSION: &str = "";
 }
+
+#[cfg(target_os = "windows")]
+pub mod os {
+    pub const FAMILY: &str = "windows";
+    pub const OS: &str = "windows";
+    pub const DLL_PREFIX: &str = "";
+    pub const DLL_SUFFIX: &str = ".dll";
+    pub const DLL_EXTENSION: &str = "dll";
+    pub const EXE_SUFFIX: &str = ".exe";
+    pub const EXE_EXTENSION: &str = "exe";
+}
diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs
index bc4bf11cb74..e7b631999e0 100644
--- a/library/std/src/sys/mod.rs
+++ b/library/std/src/sys/mod.rs
@@ -12,6 +12,7 @@ pub mod anonymous_pipe;
 pub mod args;
 pub mod backtrace;
 pub mod cmath;
+pub mod env_consts;
 pub mod exit_guard;
 pub mod fd;
 pub mod fs;
diff --git a/library/std/src/sys/pal/hermit/env.rs b/library/std/src/sys/pal/hermit/env.rs
deleted file mode 100644
index 7a0fcb31ef2..00000000000
--- a/library/std/src/sys/pal/hermit/env.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-pub mod os {
-    pub const FAMILY: &str = "";
-    pub const OS: &str = "hermit";
-    pub const DLL_PREFIX: &str = "";
-    pub const DLL_SUFFIX: &str = "";
-    pub const DLL_EXTENSION: &str = "";
-    pub const EXE_SUFFIX: &str = "";
-    pub const EXE_EXTENSION: &str = "";
-}
diff --git a/library/std/src/sys/pal/hermit/mod.rs b/library/std/src/sys/pal/hermit/mod.rs
index 821836824e2..70636760a83 100644
--- a/library/std/src/sys/pal/hermit/mod.rs
+++ b/library/std/src/sys/pal/hermit/mod.rs
@@ -18,7 +18,6 @@
 
 use crate::os::raw::c_char;
 
-pub mod env;
 pub mod futex;
 pub mod os;
 #[path = "../unsupported/pipe.rs"]
diff --git a/library/std/src/sys/pal/sgx/env.rs b/library/std/src/sys/pal/sgx/env.rs
deleted file mode 100644
index 8043b7c5213..00000000000
--- a/library/std/src/sys/pal/sgx/env.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-pub mod os {
-    pub const FAMILY: &str = "";
-    pub const OS: &str = "";
-    pub const DLL_PREFIX: &str = "";
-    pub const DLL_SUFFIX: &str = ".sgxs";
-    pub const DLL_EXTENSION: &str = "sgxs";
-    pub const EXE_SUFFIX: &str = ".sgxs";
-    pub const EXE_EXTENSION: &str = "sgxs";
-}
diff --git a/library/std/src/sys/pal/sgx/mod.rs b/library/std/src/sys/pal/sgx/mod.rs
index 8a87e7a7ae1..99735947e2c 100644
--- a/library/std/src/sys/pal/sgx/mod.rs
+++ b/library/std/src/sys/pal/sgx/mod.rs
@@ -9,7 +9,6 @@ use crate::io::ErrorKind;
 use crate::sync::atomic::{AtomicBool, Ordering};
 
 pub mod abi;
-pub mod env;
 mod libunwind_integration;
 pub mod os;
 #[path = "../unsupported/pipe.rs"]
diff --git a/library/std/src/sys/pal/solid/env.rs b/library/std/src/sys/pal/solid/env.rs
deleted file mode 100644
index 6855c113b28..00000000000
--- a/library/std/src/sys/pal/solid/env.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-pub mod os {
-    pub const FAMILY: &str = "itron";
-    pub const OS: &str = "solid";
-    pub const DLL_PREFIX: &str = "";
-    pub const DLL_SUFFIX: &str = ".so";
-    pub const DLL_EXTENSION: &str = "so";
-    pub const EXE_SUFFIX: &str = "";
-    pub const EXE_EXTENSION: &str = "";
-}
diff --git a/library/std/src/sys/pal/solid/mod.rs b/library/std/src/sys/pal/solid/mod.rs
index c41dc848a1b..0011cf256df 100644
--- a/library/std/src/sys/pal/solid/mod.rs
+++ b/library/std/src/sys/pal/solid/mod.rs
@@ -16,7 +16,6 @@ pub mod itron {
     use super::unsupported;
 }
 
-pub mod env;
 // `error` is `pub(crate)` so that it can be accessed by `itron/error.rs` as
 // `crate::sys::error`
 pub(crate) mod error;
diff --git a/library/std/src/sys/pal/teeos/mod.rs b/library/std/src/sys/pal/teeos/mod.rs
index b8095cec3e9..c7b17777258 100644
--- a/library/std/src/sys/pal/teeos/mod.rs
+++ b/library/std/src/sys/pal/teeos/mod.rs
@@ -6,9 +6,6 @@
 #![allow(unused_variables)]
 #![allow(dead_code)]
 
-#[path = "../unsupported/env.rs"]
-pub mod env;
-//pub mod fd;
 pub mod os;
 #[path = "../unsupported/pipe.rs"]
 pub mod pipe;
diff --git a/library/std/src/sys/pal/trusty/mod.rs b/library/std/src/sys/pal/trusty/mod.rs
index 04e6b4c8186..275f6062463 100644
--- a/library/std/src/sys/pal/trusty/mod.rs
+++ b/library/std/src/sys/pal/trusty/mod.rs
@@ -3,8 +3,6 @@
 #[path = "../unsupported/common.rs"]
 #[deny(unsafe_op_in_unsafe_fn)]
 mod common;
-#[path = "../unsupported/env.rs"]
-pub mod env;
 #[path = "../unsupported/os.rs"]
 pub mod os;
 #[path = "../unsupported/pipe.rs"]
diff --git a/library/std/src/sys/pal/uefi/env.rs b/library/std/src/sys/pal/uefi/env.rs
deleted file mode 100644
index c106d5fed3e..00000000000
--- a/library/std/src/sys/pal/uefi/env.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-pub mod os {
-    pub const FAMILY: &str = "";
-    pub const OS: &str = "uefi";
-    pub const DLL_PREFIX: &str = "";
-    pub const DLL_SUFFIX: &str = "";
-    pub const DLL_EXTENSION: &str = "";
-    pub const EXE_SUFFIX: &str = ".efi";
-    pub const EXE_EXTENSION: &str = "efi";
-}
diff --git a/library/std/src/sys/pal/uefi/mod.rs b/library/std/src/sys/pal/uefi/mod.rs
index cd901f48b76..bd6a36021f4 100644
--- a/library/std/src/sys/pal/uefi/mod.rs
+++ b/library/std/src/sys/pal/uefi/mod.rs
@@ -13,7 +13,6 @@
 //! [`OsString`]: crate::ffi::OsString
 #![forbid(unsafe_op_in_unsafe_fn)]
 
-pub mod env;
 pub mod helpers;
 pub mod os;
 #[path = "../unsupported/pipe.rs"]
diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs
index 3a790d9c868..a4702ae1b18 100644
--- a/library/std/src/sys/pal/unix/mod.rs
+++ b/library/std/src/sys/pal/unix/mod.rs
@@ -6,7 +6,6 @@ use crate::io::ErrorKind;
 #[macro_use]
 pub mod weak;
 
-pub mod env;
 #[cfg(target_os = "fuchsia")]
 pub mod fuchsia;
 pub mod futex;
diff --git a/library/std/src/sys/pal/unsupported/env.rs b/library/std/src/sys/pal/unsupported/env.rs
deleted file mode 100644
index d2efec506c5..00000000000
--- a/library/std/src/sys/pal/unsupported/env.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-pub mod os {
-    pub const FAMILY: &str = "";
-    pub const OS: &str = "";
-    pub const DLL_PREFIX: &str = "";
-    pub const DLL_SUFFIX: &str = "";
-    pub const DLL_EXTENSION: &str = "";
-    pub const EXE_SUFFIX: &str = "";
-    pub const EXE_EXTENSION: &str = "";
-}
diff --git a/library/std/src/sys/pal/unsupported/mod.rs b/library/std/src/sys/pal/unsupported/mod.rs
index dea42a95dcc..5e3295b1331 100644
--- a/library/std/src/sys/pal/unsupported/mod.rs
+++ b/library/std/src/sys/pal/unsupported/mod.rs
@@ -1,6 +1,5 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 
-pub mod env;
 pub mod os;
 pub mod pipe;
 pub mod thread;
diff --git a/library/std/src/sys/pal/wasi/env.rs b/library/std/src/sys/pal/wasi/env.rs
deleted file mode 100644
index 8d444982673..00000000000
--- a/library/std/src/sys/pal/wasi/env.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#![forbid(unsafe_op_in_unsafe_fn)]
-
-pub mod os {
-    pub const FAMILY: &str = "";
-    pub const OS: &str = "";
-    pub const DLL_PREFIX: &str = "";
-    pub const DLL_SUFFIX: &str = ".wasm";
-    pub const DLL_EXTENSION: &str = "wasm";
-    pub const EXE_SUFFIX: &str = ".wasm";
-    pub const EXE_EXTENSION: &str = "wasm";
-}
diff --git a/library/std/src/sys/pal/wasi/mod.rs b/library/std/src/sys/pal/wasi/mod.rs
index 4ea42b1082b..61dd1c3f98b 100644
--- a/library/std/src/sys/pal/wasi/mod.rs
+++ b/library/std/src/sys/pal/wasi/mod.rs
@@ -13,7 +13,6 @@
 //! compiling for wasm. That way it's a compile time error for something that's
 //! guaranteed to be a runtime error!
 
-pub mod env;
 #[allow(unused)]
 #[path = "../wasm/atomics/futex.rs"]
 pub mod futex;
diff --git a/library/std/src/sys/pal/wasip2/mod.rs b/library/std/src/sys/pal/wasip2/mod.rs
index 6445bf2cc0d..47fe3221c90 100644
--- a/library/std/src/sys/pal/wasip2/mod.rs
+++ b/library/std/src/sys/pal/wasip2/mod.rs
@@ -6,8 +6,6 @@
 //! To begin with, this target mirrors the wasi target 1 to 1, but over
 //! time this will change significantly.
 
-#[path = "../wasi/env.rs"]
-pub mod env;
 #[allow(unused)]
 #[path = "../wasm/atomics/futex.rs"]
 pub mod futex;
diff --git a/library/std/src/sys/pal/wasm/env.rs b/library/std/src/sys/pal/wasm/env.rs
deleted file mode 100644
index 730e356d7fe..00000000000
--- a/library/std/src/sys/pal/wasm/env.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-pub mod os {
-    pub const FAMILY: &str = "";
-    pub const OS: &str = "";
-    pub const DLL_PREFIX: &str = "";
-    pub const DLL_SUFFIX: &str = ".wasm";
-    pub const DLL_EXTENSION: &str = "wasm";
-    pub const EXE_SUFFIX: &str = ".wasm";
-    pub const EXE_EXTENSION: &str = "wasm";
-}
diff --git a/library/std/src/sys/pal/wasm/mod.rs b/library/std/src/sys/pal/wasm/mod.rs
index af370020d96..37cb46a8f6b 100644
--- a/library/std/src/sys/pal/wasm/mod.rs
+++ b/library/std/src/sys/pal/wasm/mod.rs
@@ -16,7 +16,6 @@
 
 #![deny(unsafe_op_in_unsafe_fn)]
 
-pub mod env;
 #[path = "../unsupported/os.rs"]
 pub mod os;
 #[path = "../unsupported/pipe.rs"]
diff --git a/library/std/src/sys/pal/windows/env.rs b/library/std/src/sys/pal/windows/env.rs
deleted file mode 100644
index f0a99d6200c..00000000000
--- a/library/std/src/sys/pal/windows/env.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-pub mod os {
-    pub const FAMILY: &str = "windows";
-    pub const OS: &str = "windows";
-    pub const DLL_PREFIX: &str = "";
-    pub const DLL_SUFFIX: &str = ".dll";
-    pub const DLL_EXTENSION: &str = "dll";
-    pub const EXE_SUFFIX: &str = ".exe";
-    pub const EXE_EXTENSION: &str = "exe";
-}
diff --git a/library/std/src/sys/pal/windows/mod.rs b/library/std/src/sys/pal/windows/mod.rs
index 3c0a5c2de26..4f18c4009ab 100644
--- a/library/std/src/sys/pal/windows/mod.rs
+++ b/library/std/src/sys/pal/windows/mod.rs
@@ -15,7 +15,6 @@ pub mod compat;
 pub mod api;
 
 pub mod c;
-pub mod env;
 #[cfg(not(target_vendor = "win7"))]
 pub mod futex;
 pub mod handle;
diff --git a/library/std/src/sys/pal/xous/mod.rs b/library/std/src/sys/pal/xous/mod.rs
index 4f652d3f130..383d031ed43 100644
--- a/library/std/src/sys/pal/xous/mod.rs
+++ b/library/std/src/sys/pal/xous/mod.rs
@@ -1,7 +1,5 @@
 #![forbid(unsafe_op_in_unsafe_fn)]
 
-#[path = "../unsupported/env.rs"]
-pub mod env;
 pub mod os;
 #[path = "../unsupported/pipe.rs"]
 pub mod pipe;
diff --git a/library/std/src/sys/pal/zkvm/mod.rs b/library/std/src/sys/pal/zkvm/mod.rs
index ebd7b036779..e1efa240685 100644
--- a/library/std/src/sys/pal/zkvm/mod.rs
+++ b/library/std/src/sys/pal/zkvm/mod.rs
@@ -11,7 +11,6 @@
 pub const WORD_SIZE: usize = size_of::<u32>();
 
 pub mod abi;
-pub mod env;
 pub mod os;
 #[path = "../unsupported/pipe.rs"]
 pub mod pipe;