mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
Move os_str_bytes
to sys::unix
and reuse it on other platforms.
This commit is contained in:
parent
798baebde1
commit
c93cb40b90
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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)]
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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"]
|
||||
|
@ -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"]
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user