Skip to content
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

Merged
merged 1 commit into from
Aug 2, 2021
Merged

Move os_str_bytes to sys::unix #86509

merged 1 commit into from
Aug 2, 2021

Conversation

CDirkx
Copy link
Contributor

@CDirkx CDirkx commented Jun 21, 2021

Followup to #84967, with OsStrExt and OsStringExt moved out of sys_common, there is no reason anymore for os_str_bytes to live in sys_common and not in sys. This pr moves it to the location sys::unix::os_str and reuses the code on other platforms via #[path] (as is common in sys) instead of importing.

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 21, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 21, 2021
@@ -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)))]
Copy link
Contributor Author

@CDirkx CDirkx Jun 21, 2021

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;
Copy link
Contributor Author

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.

@bors
Copy link
Contributor

bors commented Jul 2, 2021

☔ The latest upstream changes (presumably #86817) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

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"]
Copy link
Contributor Author

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).

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 18, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Aug 1, 2021

Thanks!

@bors r

@bors
Copy link
Contributor

bors commented Aug 1, 2021

📌 Commit c93cb40 has been approved by m-ou-se

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 1, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 2, 2021
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
@bors bors merged commit 1176d30 into rust-lang:master Aug 2, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants