-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move os_str_bytes
to sys::unix
#86509
Conversation
@@ -27,10 +27,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)))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore, this now completely falls under the cfg
logic in std::os
and std::sys
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should os_str
be here? Both wasi
and wasm
do use common::*
but define os_str
themselves anyway.
☔ The latest upstream changes (presumably #86817) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -13,6 +13,7 @@ use crate::sys_common::{AsInner, IntoInner}; | |||
use core::str::lossy::{Utf8Lossy, Utf8LossyChunk}; | |||
|
|||
#[cfg(test)] | |||
#[path = "../unix/os_str/tests.rs"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid duplicating the test, could alternatively be cfg(unix)
.
Thanks! @bors r+ |
📌 Commit c93cb40 has been approved by |
Rollup of 13 pull requests Successful merges: - rust-lang#86183 (Change environment variable getters to error recoverably) - rust-lang#86439 (Remove `Ipv4Addr::is_ietf_protocol_assignment`) - rust-lang#86509 (Move `os_str_bytes` to `sys::unix`) - rust-lang#86593 (Partially stabilize `const_slice_first_last`) - rust-lang#86936 (Add documentation for `Ipv6MulticastScope`) - rust-lang#87282 (Ensure `./x.py dist` adheres to `build.tools`) - rust-lang#87468 (Update rustfmt) - rust-lang#87504 (Update mdbook.) - rust-lang#87608 (Remove unused field `Session.system_library_path`) - rust-lang#87629 (Consistent spelling of "adapter" in the standard library) - rust-lang#87633 (Update compiler_builtins to fix i128 shift/mul on thumbv6m) - rust-lang#87644 (Recommend `swap_remove` in `Vec::remove` docs) - rust-lang#87653 (mark a UB doctest as no_run) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Followup to #84967, with
OsStrExt
andOsStringExt
moved out ofsys_common
, there is no reason anymore foros_str_bytes
to live insys_common
and not in sys. This pr moves it to the locationsys::unix::os_str
and reuses the code on other platforms via#[path]
(as is common insys
) instead of importing.