-
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
std: Tidy up some unsafe impl
s for sync
#22596
Conversation
This commit removes many unnecessary `unsafe impl` blocks as well as pushing the needed implementations to the lowest level possible. I noticed that the bounds for `RwLock` are a little off when reviewing rust-lang#22574 and wanted to ensure that we had our story straight on these implementations.
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -16,6 +16,12 @@ use fmt; | |||
use thread; | |||
|
|||
pub struct Flag { failed: UnsafeCell<bool> } | |||
|
|||
// This flag is only ever accessed with a lock previously held. Note that this | |||
// a totally private structure. |
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.
"totally private" ... pub struct Flag
. :P
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.
nice ;)
@bors r+ 64fe |
This commit removes many unnecessary `unsafe impl` blocks as well as pushing the needed implementations to the lowest level possible. I noticed that the bounds for `RwLock` are a little off when reviewing rust-lang#22574 and wanted to ensure that we had our story straight on these implementations.
⌛ Testing commit 64fe93e with merge 0d6e229... |
💔 Test failed - auto-linux-64-x-android-t |
@bors: retry |
⚡ Previous build results are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-32-nopt-t, auto-win-32-opt, auto-win-64-nopt-t, auto-win-64-opt... |
1 similar comment
⚡ Previous build results are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-32-nopt-t, auto-win-32-opt, auto-win-64-nopt-t, auto-win-64-opt... |
💔 Test failed - auto-win-32-nopt-t |
@bors: retry (Please ignore the failures for now) |
⚡ Previous build results are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-32-nopt-t, auto-win-32-opt, auto-win-64-nopt-t, auto-win-64-opt... |
💔 Test failed - auto-mac-64-opt |
This commit removes many unnecessary
unsafe impl
blocks as well as pushing theneeded implementations to the lowest level possible. I noticed that the bounds
for
RwLock
are a little off when reviewing #22574 and wanted to ensure that wehad our story straight on these implementations.