-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Consolidate some duplicate code in the sys modules. #75749
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
cc @alexcrichton modifies wasi |
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.
Thanks for the ping! LGTM modulo one comment. Also I assume if we do ever implement (parts) of these APIs we can just (partially) undo this change.
pub mod fs; | ||
#[path = "../unsupported/io.rs"] | ||
pub mod io; |
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.
It seems a little strange to pull the IoSlice types from somewhere with “unsupported” in the name, as these types are actually used and supported on this target.
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.
Yea, good point. I can't think of a good place to put this module, since there isn't a location for "basic implementation that is not Unix". Would it make sense to add a sys::basic
module that contained code like this? The only other "functional" code in the unsupported
tree is:
☔ The latest upstream changes (presumably #75971) made this pull request unmergeable. Please resolve the merge conflicts. |
bdb84d7
to
90b941d
Compare
@sfackler do you think you'll be able to review this? |
merging this given that there was one approval even though not from the reviewer. @bors r=sfackler |
📌 Commit 90b941d05147a81a8236365bcf380e01f20a3ed1 has been approved by |
⌛ Testing commit 90b941d05147a81a8236365bcf380e01f20a3ed1 with merge 7ee2bd15797d69501f36b94f083f18031d11893c... |
💔 Test failed - checks-actions |
|
90b941d
to
25cca07
Compare
Not sure how I missed that attribute, I thought I had tested it. @bors r=alexcrichton |
📌 Commit 25cca07 has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#73955 (deny(unsafe_op_in_unsafe_fn) in libstd/process.rs) - rust-lang#75146 (Detect overflow in proc_macro_server subspan) - rust-lang#75304 (Note when a a move/borrow error is caused by a deref coercion) - rust-lang#75749 (Consolidate some duplicate code in the sys modules.) - rust-lang#75882 (Use translated variable for test string) - rust-lang#75886 (Test that bounds checks are elided for [..index] after .position()) - rust-lang#76048 (Initial support for riscv32gc_unknown_linux_gnu) - rust-lang#76198 (Make some Ordering methods const) - rust-lang#76689 (Upgrade to pulldown-cmark 0.8.0) - rust-lang#76763 (Update cargo) Failed merges: r? `@ghost`
This consolidates some modules which were duplicated throughout the sys module. The intent is to make it easier to update and maintain this code. This mainly affects the wasi, sgx, and "unsupported" targets.
I explicitly skipped hermit, cloudabi, and vxworks. These tier-3 targets have copied large sections of the sys tree. I don't think they should have, but I don't want to put effort into changing them. It also doesn't help that there aren't any scripts or instructions for building them.
There are still sections of duplicate code here and there, but this PR covers the easy parts where entire modules are the same.