Move std::sys_common::alloc to new module std::sys::common#82492
Move std::sys_common::alloc to new module std::sys::common#82492bors merged 2 commits intorust-lang:masterfrom
std::sys_common::alloc to new module std::sys::common#82492Conversation
|
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::syshas 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 betweensysandsys_common, this is becausesys_commoncontains 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
commontostd::syswhich will contain code shared between platforms,alloc.rsin this case but more can be moved over in the future.