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:
Nadrieril 2024-01-21 06:38:37 +01:00 committed by GitHub
commit a1b41a9048
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 13 additions and 21 deletions

View File

@ -3,6 +3,7 @@
/// descriptors.
mod pal;
pub mod os_str;
mod personality;
// FIXME(117276): remove this, move feature implementations into individual

View File

@ -14,7 +14,6 @@
use core::str::Utf8Chunks;
#[cfg(test)]
#[path = "../unix/os_str/tests.rs"]
mod tests;
#[derive(Hash)]

View 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};
}
}

View File

@ -30,8 +30,6 @@
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"]

View File

@ -24,8 +24,6 @@
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;

View File

@ -31,8 +31,6 @@ mod itron {
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;

View File

@ -27,8 +27,6 @@
#[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"]

View File

@ -28,8 +28,6 @@
#[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;

View File

@ -29,7 +29,6 @@
#[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;

View File

@ -11,8 +11,6 @@
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;

View File

@ -32,8 +32,6 @@
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"]

View File

@ -30,8 +30,6 @@
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"]

View File

@ -24,7 +24,6 @@
pub mod memchr;
pub mod net;
pub mod os;
pub mod os_str;
pub mod path;
pub mod pipe;
pub mod process;

View File

@ -17,8 +17,6 @@
#[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"]