-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Window Mutex: Document that we properly initialize the SRWLock #53311
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
68a1528
to
8a72954
Compare
src/libstd/sys/windows/mutex.rs
Outdated
@@ -58,6 +58,8 @@ pub unsafe fn raw(m: &Mutex) -> c::PSRWLOCK { | |||
impl Mutex { | |||
pub const fn new() -> Mutex { | |||
Mutex { | |||
// This works because SRWLOCK_INIT is a NULL pointer, so we are also properly |
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.
Technically SRWLOCK
is a struct wrapping a pointer which isn't actually used as a pointer, so SRWLOCK_INIT
is zero initializing a struct.
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.
Oh wow. I guess Windows API doesn't really care about meaningful types?
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.
Fixed, I hope.
r? @retep998 |
As much as I'd love to r+ this PR, I don't have such permissions, so someone else will have to actually r+ it. |
@bors r=retep998 |
📌 Commit b7a49e7 has been approved by |
⌛ Testing commit b7a49e7 with merge 8a1ba374f7ae73fd0752f4fc26b9bec5a9268981... |
💔 Test failed - status-travis |
This comment has been minimized.
This comment has been minimized.
@bors retry rollup Travis hiccups. |
Window Mutex: Document that we properly initialize the SRWLock See rust-lang#35836
Rollup of 16 pull requests Successful merges: - #53311 (Window Mutex: Document that we properly initialize the SRWLock) - #53503 (Discourage overuse of mem::forget) - #53545 (Fix #50865: ICE on impl-trait returning functions reaching private items) - #53559 (add macro check for lint) - #53562 (Lament the invincibility of the Turbofish) - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()) - #53592 (docs: minor stylistic changes to str/string docs) - #53594 (Update RELEASES.md to include clippy-preview) - #53600 (Fix a grammatical mistake in "expected generic arguments" errors) - #53614 (update nomicon and book) - #53617 (tidy: Stop requiring a license header) - #53618 (Add missing fmt examples) - #53636 (Prefer `.nth(n)` over `.skip(n).next()`.) - #53644 (Use SmallVec for SmallCStr) - #53664 (Remove unnecessary closure in rustc_mir/build/mod.rs) - #53666 (Added rustc_codegen_llvm to compiler documentation.)
See #35836