-
Notifications
You must be signed in to change notification settings - Fork 13.9k
move once
module out of poison
#147125
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 once
module out of poison
#147125
Conversation
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
r? @tgross35 |
|
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.
A few nits here then r=me
Additionally:
1. Renames `once::ExclusiveState` to `OnceExclusiveState` since it was a bit confusing reading just `ExclusiveState` where it is used. 2. Reorders a few module definitions and re-exports in `library/std/src/sync/mod.rs` for clarity.
For future reference, since these and the original Once
change are all orthogonal, they'd ideally be split to three separate commits. It's a separation of concerns (cleanup vs. behavior change) and makes the diffs easier to follow.
Condvar, | ||
Once, OnceState, | ||
RwLock, RwLockReadGuard, RwLockWriteGuard, | ||
}; |
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.
Looks like alphabetical ordering may have gotten flipped between Mutex
and TryLockError
. (would be nice if we could just remove the rustfmt::skip
from this module but it does make things messy)
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.
I actually did this purposefully (though Condvar
should probably come after RwLock
now that I think about it because RwLock
relies on TryLockError
too). Once I finish revisions let me know if the ordering makes sense (commit 7b61403)
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
It is a bit confusing when reading code that uses this type since it is not immediately obvious that it is specific to `Once`. Signed-off-by: Connor Tsui <[email protected]>
ef16d45
to
dca5bc2
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Signed-off-by: Connor Tsui <[email protected]>
Moves things around to make a bit more sense (plus prepare moving `once` out of `poison`. Signed-off-by: Connor Tsui <[email protected]>
Since `Once` will not have a non-poisoning variant, we remove it from the `poison` module. Signed-off-by: Connor Tsui <[email protected]>
dca5bc2
to
3a9c521
Compare
@rustbot ready (Also sorry about the commit hygiene I think I was just being lazy) |
No worries, we don't have any commit guidelines so it's just nice to have rather than required :). Thanks for doing it now, though! @bors r+ rollup |
…=tgross35 move `once` module out of `poison` From rust-lang#134645 (comment), since `Once` will not have a non-poisoning variant, we remove it from the `poison` module. Additionally: 1. Renames `once::ExclusiveState` to `OnceExclusiveState` since it was a bit confusing reading just `ExclusiveState` where it is used. 2. Reorders a few module definitions and re-exports in `library/std/src/sync/mod.rs` for clarity. Also, once this is merged, I think that we can begin the process of stabilizing [`sync_poison_mod`](rust-lang#134646)
Rollup of 5 pull requests Successful merges: - #147125 (move `once` module out of `poison`) - #147800 (Add `Cacheable` trait alias in `rustc_public_bridge`) - #147860 (rustdoc search: relax rules for identifiers) - #147916 (Update books) - #147924 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147125 - connortsui20:poison-once-remove, r=tgross35 move `once` module out of `poison` From #134645 (comment), since `Once` will not have a non-poisoning variant, we remove it from the `poison` module. Additionally: 1. Renames `once::ExclusiveState` to `OnceExclusiveState` since it was a bit confusing reading just `ExclusiveState` where it is used. 2. Reorders a few module definitions and re-exports in `library/std/src/sync/mod.rs` for clarity. Also, once this is merged, I think that we can begin the process of stabilizing [`sync_poison_mod`](#134646)
From #134645 (comment), since
Once
will not have a non-poisoning variant, we remove it from thepoison
module.Additionally:
once::ExclusiveState
toOnceExclusiveState
since it was a bit confusing reading justExclusiveState
where it is used.library/std/src/sync/mod.rs
for clarity.Also, once this is merged, I think that we can begin the process of stabilizing
sync_poison_mod