<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/sync/mutex.rs, branch 1.68.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.68.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.68.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-11-06T14:32:59+00:00</updated>
<entry>
<title>std: remove lock wrappers in `sys_common`</title>
<updated>2022-11-06T14:32:59+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2022-10-18T11:23:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=98815742cf2e914ee0d7142a02322cf939c47834'/>
<id>urn:sha1:98815742cf2e914ee0d7142a02322cf939c47834</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #97739 - a2aaron:let_underscore, r=estebank</title>
<updated>2022-09-02T09:34:45+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2022-09-02T09:34:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=07f43a1ca179c624996b1095a314566733d2e017'/>
<id>urn:sha1:07f43a1ca179c624996b1095a314566733d2e017</id>
<content type='text'>
Uplift the `let_underscore` lints from clippy into rustc.

This PR resolves #97241.

This PR adds three lints from clippy--`let_underscore_drop`, `let_underscore_lock`, and `let_underscore_must_use`, which are meant to capture likely-incorrect uses of `let _ = ...` bindings (in particular, doing this on a type with a non-trivial `Drop` causes the `Drop` to occur immediately, instead of at the end of the scope. For a type like `MutexGuard`, this effectively releases the lock immediately, which is almost certainly the wrong behavior)

In porting the lints from clippy I had to copy over a bunch of utility functions from `clippy_util` that these lints also relied upon. Is that the right approach?

Note that I've set the `must_use` and `drop` lints to Allow by default and set `lock` to Deny by default (this matches the same settings that clippy has). In talking with `@estebank` he informed me to do a Crater run (I am not sure what type of Crater run to request here--I think it's just "check only"?)

On the linked issue, there's some discussion about using `must_use` and `Drop` together as a heuristic for when to warn--I did not implement this yet.

r? `@estebank`
</content>
</entry>
<entry>
<title>Auto merge of #97791 - m-ou-se:const-locks, r=m-ou-se</title>
<updated>2022-06-19T08:20:36+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2022-06-19T08:20:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=15fc228d0d0a68b5ba565758fab13ed7f863fcea'/>
<id>urn:sha1:15fc228d0d0a68b5ba565758fab13ed7f863fcea</id>
<content type='text'>
Make {Mutex, Condvar, RwLock}::new() const.

This makes it possible to have `static M: Mutex&lt;_&gt; = Mutex::new(..);` 🎉

Our implementations [on Linux](https://github.com/rust-lang/rust/pull/95035), [on Windows](https://github.com/rust-lang/rust/pull/77380), and various BSDs and some tier 3 platforms have already been using a non-allocating const-constructible implementation. As of https://github.com/rust-lang/rust/pull/97647, the remaining platforms (most notably macOS) now have a const-constructible implementation as well. This means we can finally make these functions publicly const.

Tracking issue: https://github.com/rust-lang/rust/issues/93740
</content>
</entry>
<entry>
<title>Avoid `thread::panicking()` in non-poisoning methods of `Mutex` and `RwLock`</title>
<updated>2022-06-09T18:51:39+00:00</updated>
<author>
<name>Josh Stone</name>
<email>jistone@redhat.com</email>
</author>
<published>2022-06-09T18:51:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=34895ded2c76cc87dc6ff33adaa541c239d416bf'/>
<id>urn:sha1:34895ded2c76cc87dc6ff33adaa541c239d416bf</id>
<content type='text'>
`Mutex::lock()` and `RwLock::write()` are poison-guarded against panics,
in that they set the poison flag if a panic occurs while they're locked.
But if we're already in a panic (`thread::panicking()`), they leave the
poison flag alone.

That check is a bit of a waste for methods that never set the poison
flag though, namely `get_mut()`, `into_inner()`, and `RwLock::read()`.
These use-cases are now split to avoid that unnecessary call.
</content>
</entry>
<entry>
<title>Update library/std/src/sync/mutex.rs</title>
<updated>2022-06-07T13:15:19+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>99973273+Dylan-DPC@users.noreply.github.com</email>
</author>
<published>2022-06-07T13:15:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e224185409bd20b91c5eb0652748283658d7c4dd'/>
<id>urn:sha1:e224185409bd20b91c5eb0652748283658d7c4dd</id>
<content type='text'>
Co-authored-by: Weiyi Wang &lt;wwylele@gmail.com&gt;</content>
</entry>
<entry>
<title>Remove confusing sentence from `Mutex` docs</title>
<updated>2022-06-07T07:53:44+00:00</updated>
<author>
<name>Nilstrieb</name>
<email>48135649+Nilstrieb@users.noreply.github.com</email>
</author>
<published>2022-06-07T07:53:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=83af085c777fb71e49a132a6a713aa93fb4f2019'/>
<id>urn:sha1:83af085c777fb71e49a132a6a713aa93fb4f2019</id>
<content type='text'>
The docs were saying something about "statically initializing" the
mutex, and it's not clear what this means. Remove that part to avoid
confusion.
</content>
</entry>
<entry>
<title>Make {Mutex, Condvar, RwLock}::new() const.</title>
<updated>2022-06-06T11:55:43+00:00</updated>
<author>
<name>Mara Bos</name>
<email>m-ou.se@m-ou.se</email>
</author>
<published>2022-06-06T11:55:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=edae4958556a6150841b9964b322d1e96e7a4586'/>
<id>urn:sha1:edae4958556a6150841b9964b322d1e96e7a4586</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make all {Mutex, Condvar, RwLock}::new #[inline].</title>
<updated>2022-06-06T11:49:23+00:00</updated>
<author>
<name>Mara Bos</name>
<email>m-ou.se@m-ou.se</email>
</author>
<published>2022-06-06T11:45:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=acc3ab4e65cfe4c11156ba7b6be0a33625e7626b'/>
<id>urn:sha1:acc3ab4e65cfe4c11156ba7b6be0a33625e7626b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add diagnostic items to MutexGuard and RwLock Guards</title>
<updated>2022-06-05T05:01:54+00:00</updated>
<author>
<name>Aaron Kofsky</name>
<email>aaronko@umich.edu</email>
</author>
<published>2022-06-05T05:01:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=321a598b7519733aff7dea8b4ebd3631626d656b'/>
<id>urn:sha1:321a598b7519733aff7dea8b4ebd3631626d656b</id>
<content type='text'>
I forgot to add the diagnostic to the actual types in `std` earlier.
</content>
</entry>
<entry>
<title>Auto merge of #96422 - tmccombs:mutex-unpoison, r=m-ou-se</title>
<updated>2022-05-20T08:06:56+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2022-05-20T08:06:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cd73afadae5b0163f9285f1b5edbbd1c84fde410'/>
<id>urn:sha1:cd73afadae5b0163f9285f1b5edbbd1c84fde410</id>
<content type='text'>
Add functions to un-poison Mutex and RwLock

See discussion at https://internals.rust-lang.org/t/unpoisoning-a-mutex/16521/3
</content>
</entry>
</feed>
