-
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
Move sys_common::rwlock::StaticRWLock
etc. to sys::unix::rwlock
#84402
Conversation
r? @dtolnay (rust-highfive has picked a reviewer for you, use r? to override) |
I was also thinking about removing |
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, 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.
@bors r+ |
📌 Commit eb9b0f6 has been approved by |
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
,RWLockReadGuard
andRWLockWriteGuard
tosys::unix::rwlock
. They are already#[cfg(unix)]
and don't need to be insys_common
.Part of #84187.