-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 std::sys_common::alloc
to new module std::sys::common
#82492
Conversation
r? @sfackler (rust-highfive has picked a reviewer for you, use r? to override) |
r? @m-ou-se |
This looks good to me, but I'm a bit worried about the existence of both Thanks! |
I agree on the confusion. Once all the common code is eventually split out of |
79f22fd
to
cac0dd6
Compare
I added some documentation and set up #84187 to track the progress of moving over code from |
Thanks! @bors r+ rollup |
📌 Commit cac0dd6 has been approved by |
Move `std::sys_common::alloc` to new module `std::sys::common` https://github.com/rust-lang/rust/blob/6b56603e35b39c9f6cc76782330e5e415f9e43d5/library/std/src/sys_common/mod.rs#L7-L13 It was my impression that the goal for `std::sys` has changed from extracting it into a separate crate to making std work with features. However the fact remains that there is a lot of interdependence between `sys` and `sys_common`, this is because `sys_common` contains two types of code: - abstractions over the different platform implementations in `std::sys` (for example [`std::sys_common::mutex`](https://github.com/rust-lang/rust/blob/master/library/std/src/sys_common/mutex.rs)) - code shared between platforms (for example [`std::sys_common::alloc`](https://github.com/rust-lang/rust/blob/master/library/std/src/sys_common/alloc.rs)) This PR attempts to address this by adding a new module `common` to `std::sys` which will contain code shared between platforms, `alloc.rs` in this case but more can be moved over in the future.
Move `std::sys_common::alloc` to new module `std::sys::common` https://github.com/rust-lang/rust/blob/6b56603e35b39c9f6cc76782330e5e415f9e43d5/library/std/src/sys_common/mod.rs#L7-L13 It was my impression that the goal for `std::sys` has changed from extracting it into a separate crate to making std work with features. However the fact remains that there is a lot of interdependence between `sys` and `sys_common`, this is because `sys_common` contains two types of code: - abstractions over the different platform implementations in `std::sys` (for example [`std::sys_common::mutex`](https://github.com/rust-lang/rust/blob/master/library/std/src/sys_common/mutex.rs)) - code shared between platforms (for example [`std::sys_common::alloc`](https://github.com/rust-lang/rust/blob/master/library/std/src/sys_common/alloc.rs)) This PR attempts to address this by adding a new module `common` to `std::sys` which will contain code shared between platforms, `alloc.rs` in this case but more can be moved over in the future.
Rollup of 7 pull requests Successful merges: - rust-lang#82492 (Move `std::sys_common::alloc` to new module `std::sys::common`) - rust-lang#84177 (Fix join_paths error display.) - rust-lang#84185 (add more pat2021 tests) - rust-lang#84191 (Update books) - rust-lang#84192 (Fix typos in rustc_codegen_ssa/src/back/write.rs.) - rust-lang#84196 (:arrow_up: rust-analyzer) - rust-lang#84201 (rustdoc: Note that forbidding anchors in links to primitives is a bug) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
rust/library/std/src/sys_common/mod.rs
Lines 7 to 13 in 6b56603
It was my impression that the goal for
std::sys
has changed from extracting it into a separate crate to making std work with features. However the fact remains that there is a lot of interdependence betweensys
andsys_common
, this is becausesys_common
contains two types of code:std::sys
(for examplestd::sys_common::mutex
)std::sys_common::alloc
)This PR attempts to address this by adding a new module
common
tostd::sys
which will contain code shared between platforms,alloc.rs
in this case but more can be moved over in the future.