diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2021-06-21 11:44:59 +0200 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2021-07-03 03:01:36 +0200 |
| commit | c93cb40b90b5f862bf448136cbe608f43ae0f62f (patch) | |
| tree | 5dc4e6408de2db97d863c62ee9298b24fa0bde53 | |
| parent | 798baebde1fe77e5a660490ec64e727a5d79970d (diff) | |
| download | rust-c93cb40b90b5f862bf448136cbe608f43ae0f62f.tar.gz rust-c93cb40b90b5f862bf448136cbe608f43ae0f62f.zip | |
Move `os_str_bytes` to `sys::unix` and reuse it on other platforms.
| -rw-r--r-- | library/std/src/sys/hermit/mod.rs | 3 | ||||
| -rw-r--r-- | library/std/src/sys/sgx/mod.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/unix/mod.rs | 3 | ||||
| -rw-r--r-- | library/std/src/sys/unix/os_str.rs (renamed from library/std/src/sys_common/os_str_bytes.rs) | 1 | ||||
| -rw-r--r-- | library/std/src/sys/unix/os_str/tests.rs (renamed from library/std/src/sys_common/os_str_bytes/tests.rs) | 0 | ||||
| -rw-r--r-- | library/std/src/sys/unsupported/common.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/unsupported/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/wasi/mod.rs | 3 | ||||
| -rw-r--r-- | library/std/src/sys/wasm/mod.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys_common/mod.rs | 4 |
10 files changed, 12 insertions, 14 deletions
diff --git a/library/std/src/sys/hermit/mod.rs b/library/std/src/sys/hermit/mod.rs index 10c19424953..185b68c0a78 100644 --- a/library/std/src/sys/hermit/mod.rs +++ b/library/std/src/sys/hermit/mod.rs @@ -32,6 +32,8 @@ pub mod memchr; pub mod mutex; pub mod net; pub mod os; +#[path = "../unix/os_str.rs"] +pub mod os_str; #[path = "../unix/path.rs"] pub mod path; #[path = "../unsupported/pipe.rs"] @@ -47,7 +49,6 @@ pub mod thread_local_key; pub mod time; use crate::io::ErrorKind; -pub use crate::sys_common::os_str_bytes as os_str; #[allow(unused_extern_crates)] pub extern crate hermit_abi as abi; diff --git a/library/std/src/sys/sgx/mod.rs b/library/std/src/sys/sgx/mod.rs index fce6b420732..a2a763c2b4e 100644 --- a/library/std/src/sys/sgx/mod.rs +++ b/library/std/src/sys/sgx/mod.rs @@ -26,6 +26,8 @@ pub mod memchr; pub mod mutex; pub mod net; pub mod os; +#[path = "../unix/os_str.rs"] +pub mod os_str; pub mod path; #[path = "../unsupported/pipe.rs"] pub mod pipe; @@ -37,8 +39,6 @@ pub mod thread; pub mod thread_local_key; pub mod time; -pub use crate::sys_common::os_str_bytes as os_str; - // SAFETY: must be called only once during runtime initialization. // NOTE: this is not guaranteed to run, for example when Rust code is called externally. pub unsafe fn init(argc: isize, argv: *const *const u8) { diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 8eebdf9f548..44bb5ffd35d 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -30,6 +30,7 @@ pub mod net; #[cfg(target_os = "l4re")] pub use self::l4re::net; pub mod os; +pub mod os_str; pub mod path; pub mod pipe; pub mod process; @@ -42,8 +43,6 @@ pub mod thread_local_dtor; pub mod thread_local_key; pub mod time; -pub use crate::sys_common::os_str_bytes as os_str; - // SAFETY: must be called only once during runtime initialization. // NOTE: this is not guaranteed to run, for example when Rust code is called externally. pub unsafe fn init(argc: isize, argv: *const *const u8) { diff --git a/library/std/src/sys_common/os_str_bytes.rs b/library/std/src/sys/unix/os_str.rs index 569600470db..ae96d6b4df4 100644 --- a/library/std/src/sys_common/os_str_bytes.rs +++ b/library/std/src/sys/unix/os_str.rs @@ -13,6 +13,7 @@ use crate::sys_common::{AsInner, IntoInner}; use core::str::lossy::{Utf8Lossy, Utf8LossyChunk}; #[cfg(test)] +#[path = "../unix/os_str/tests.rs"] mod tests; #[derive(Hash)] diff --git a/library/std/src/sys_common/os_str_bytes/tests.rs b/library/std/src/sys/unix/os_str/tests.rs index 37967378155..37967378155 100644 --- a/library/std/src/sys_common/os_str_bytes/tests.rs +++ b/library/std/src/sys/unix/os_str/tests.rs diff --git a/library/std/src/sys/unsupported/common.rs b/library/std/src/sys/unsupported/common.rs index 4e6c301d29f..a06b44e96a9 100644 --- a/library/std/src/sys/unsupported/common.rs +++ b/library/std/src/sys/unsupported/common.rs @@ -4,8 +4,6 @@ pub mod memchr { pub use core::slice::memchr::{memchr, memrchr}; } -pub use crate::sys_common::os_str_bytes as os_str; - // This is not necessarily correct. May want to consider making it part of the // spec definition? use crate::os::raw::c_char; diff --git a/library/std/src/sys/unsupported/mod.rs b/library/std/src/sys/unsupported/mod.rs index 3ef4c6b8a8f..a1276193bda 100644 --- a/library/std/src/sys/unsupported/mod.rs +++ b/library/std/src/sys/unsupported/mod.rs @@ -11,6 +11,8 @@ pub mod io; pub mod mutex; pub mod net; pub mod os; +#[path = "../unix/os_str.rs"] +pub mod os_str; #[path = "../unix/path.rs"] pub mod path; pub mod pipe; diff --git a/library/std/src/sys/wasi/mod.rs b/library/std/src/sys/wasi/mod.rs index 4af99bfa464..8d62335aae5 100644 --- a/library/std/src/sys/wasi/mod.rs +++ b/library/std/src/sys/wasi/mod.rs @@ -32,7 +32,8 @@ pub mod io; pub mod mutex; pub mod net; pub mod os; -pub use crate::sys_common::os_str_bytes as os_str; +#[path = "../unix/os_str.rs"] +pub mod os_str; #[path = "../unix/path.rs"] pub mod path; #[path = "../unsupported/pipe.rs"] diff --git a/library/std/src/sys/wasm/mod.rs b/library/std/src/sys/wasm/mod.rs index cd701a333f8..c81d653a5e3 100644 --- a/library/std/src/sys/wasm/mod.rs +++ b/library/std/src/sys/wasm/mod.rs @@ -30,6 +30,8 @@ pub mod io; pub mod net; #[path = "../unsupported/os.rs"] pub mod os; +#[path = "../unix/os_str.rs"] +pub mod os_str; #[path = "../unix/path.rs"] pub mod path; #[path = "../unsupported/pipe.rs"] @@ -45,8 +47,6 @@ pub mod thread_local_key; #[path = "../unsupported/time.rs"] pub mod time; -pub use crate::sys_common::os_str_bytes as os_str; - cfg_if::cfg_if! { if #[cfg(target_feature = "atomics")] { #[path = "atomics/condvar.rs"] diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs index db83bad60d8..894440564b7 100644 --- a/library/std/src/sys_common/mod.rs +++ b/library/std/src/sys_common/mod.rs @@ -26,10 +26,6 @@ pub mod fs; pub mod io; pub mod memchr; pub mod mutex; -// `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 process; pub mod remutex; #[macro_use] |
