Uh oh!
There was an error while loading. Please reload this page.
Move sys_common::rwlock::StaticRWLock etc. to sys::unix::rwlock - #84402
Conversation
rust-highfive
commented
Apr 21, 2021
r? @dtolnay (rust-highfive has picked a reviewer for you, use r? to override) |
I was also thinking about removing |
dtolnay
left a comment
There was a problem hiding this comment.
Thanks, looks good.
Regarding sys_common::rwlock::RWLock — it looks to me like that wrapper type is serving exactly the purpose of a trait, i.e. a consistent set of methods with documented guarantees that the various implementations must provide. So how about replacing it with a RWLock trait instead? The trait would take the place of the current wrapper, in sys_common. The implementations would stay in sys, and would now have all their methods in a trait impl rather than inherent methods. The trait fulfills the current role of the wrapper type by ensuring that the various implementations all expose the same API.
dtolnay
commented
Apr 21, 2021
@bors r+ |
bors
commented
Apr 21, 2021
📌 Commit eb9b0f6 has been approved by |
CDirkx
commented
Apr 21, 2021
Yeah using traits for that could be a good idea. I'll look into other types that may also be applicable to. |
Move `sys_common::rwlock::StaticRWLock` etc. to `sys::unix::rwlock` This moves `sys_common::rwlock::StaticRwLock`, `RWLockReadGuard` and `RWLockWriteGuard` to `sys::unix::rwlock`. They are already `#[cfg(unix)]` and don't need to be in `sys_common`.
Rollup of 7 pull requests Successful merges: - rust-lang#84343 (Remove `ScopeTree::closure_tree`) - rust-lang#84376 (Uses flex to fix formatting of h1 at any width) - rust-lang#84377 (Followup to rust-lang#83944) - rust-lang#84396 (Update LLVM submodule) - rust-lang#84402 (Move `sys_common::rwlock::StaticRWLock` etc. to `sys::unix::rwlock`) - rust-lang#84404 (Check for intrinsics before coercing to a function pointer) - rust-lang#84413 (Remove `sys::args::Args::inner_debug` and use `Debug` instead) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This moves
sys_common::rwlock::StaticRwLock,RWLockReadGuardandRWLockWriteGuardtosys::unix::rwlock. They are already#[cfg(unix)]and don't need to be insys_common.Part of #84187.