mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Rollup merge of #119996 - joboet:move_pal_os_str, r=ChrisDenton
Move OS String implementation into `sys` Part of #117276. The new structure is really useful here, since we can easily eliminate a number of ugly `#[path]`-based imports. In the future, it might be good to move the WTF-8 implementation directly to the OS string implementation, I cannot see it being used anywhere else. That is a story for another PR, however.
This commit is contained in:
commit
a1b41a9048
@ -3,6 +3,7 @@
|
||||
/// descriptors.
|
||||
mod pal;
|
||||
|
||||
pub mod os_str;
|
||||
mod personality;
|
||||
|
||||
// FIXME(117276): remove this, move feature implementations into individual
|
||||
|
@ -14,7 +14,6 @@ use crate::sys_common::{AsInner, IntoInner};
|
||||
use core::str::Utf8Chunks;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "../unix/os_str/tests.rs"]
|
||||
mod tests;
|
||||
|
||||
#[derive(Hash)]
|
12
library/std/src/sys/os_str/mod.rs
Normal file
12
library/std/src/sys/os_str/mod.rs
Normal file
@ -0,0 +1,12 @@
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(any(
|
||||
target_os = "windows",
|
||||
target_os = "uefi",
|
||||
))] {
|
||||
mod wtf8;
|
||||
pub use wtf8::{Buf, Slice};
|
||||
} else {
|
||||
mod bytes;
|
||||
pub use bytes::{Buf, Slice};
|
||||
}
|
||||
}
|
@ -30,8 +30,6 @@ pub mod io;
|
||||
pub mod memchr;
|
||||
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"]
|
||||
|
@ -24,8 +24,6 @@ pub mod io;
|
||||
pub mod memchr;
|
||||
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;
|
||||
|
@ -31,8 +31,6 @@ pub mod fs;
|
||||
pub mod io;
|
||||
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;
|
||||
|
@ -27,8 +27,6 @@ pub mod net;
|
||||
#[path = "../unsupported/once.rs"]
|
||||
pub mod once;
|
||||
pub mod os;
|
||||
#[path = "../unix/os_str.rs"]
|
||||
pub mod os_str;
|
||||
#[path = "../unix/path.rs"]
|
||||
pub mod path;
|
||||
#[path = "../unsupported/pipe.rs"]
|
||||
|
@ -28,8 +28,6 @@ pub mod net;
|
||||
#[path = "../unsupported/once.rs"]
|
||||
pub mod once;
|
||||
pub mod os;
|
||||
#[path = "../windows/os_str.rs"]
|
||||
pub mod os_str;
|
||||
pub mod path;
|
||||
#[path = "../unsupported/pipe.rs"]
|
||||
pub mod pipe;
|
||||
|
@ -29,7 +29,6 @@ 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;
|
||||
|
@ -11,8 +11,6 @@ pub mod locks;
|
||||
pub mod net;
|
||||
pub mod once;
|
||||
pub mod os;
|
||||
#[path = "../unix/os_str.rs"]
|
||||
pub mod os_str;
|
||||
#[path = "../unix/path.rs"]
|
||||
pub mod path;
|
||||
pub mod pipe;
|
||||
|
@ -32,8 +32,6 @@ pub mod io;
|
||||
|
||||
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"]
|
||||
|
@ -30,8 +30,6 @@ 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"]
|
||||
|
@ -24,7 +24,6 @@ pub mod locks;
|
||||
pub mod memchr;
|
||||
pub mod net;
|
||||
pub mod os;
|
||||
pub mod os_str;
|
||||
pub mod path;
|
||||
pub mod pipe;
|
||||
pub mod process;
|
||||
|
@ -17,8 +17,6 @@ pub mod net;
|
||||
#[path = "../unsupported/once.rs"]
|
||||
pub mod once;
|
||||
pub mod os;
|
||||
#[path = "../unix/os_str.rs"]
|
||||
pub mod os_str;
|
||||
#[path = "../unix/path.rs"]
|
||||
pub mod path;
|
||||
#[path = "../unsupported/pipe.rs"]
|
||||
|
Loading…
Reference in New Issue
Block a user