| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Based on the review made by dtolnay.
|
|
Co-authored-by: David Tolnay <dtolnay@gmail.com>
|
|
|
|
Co-authored-by: LeSeulArtichaut <leseulartichaut@gmail.com>
|
|
mutex holding it
|
|
|
|
This adds a couple of more diagnostic items to be used in Clippy.
I chose these particular ones because they were the types which we seem
to check for the most in Clippy. I'm not sure if the
`cfg_attr(not(test))` is needed, but it was also used for `Vec` and a
few other types.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Use more impl header lifetime elision
Inspired by seeing explicit lifetimes on these two:
- https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator
- https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not
And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore.
Most of the changes in here fall into two big categories:
- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`)
- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)
I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm).
I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
|
|
There are two big categories of changes in here
- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`)
- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)
I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
|
|
|
|
Just transparently print the guarded data, instead of wrapping it in
`MutexGuard { lock: Mutex { data: ... } }`.
|
|
Fixes #57702.
|
|
|
|
Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.
|
|
|
|
Signed-off-by: NODA, Kai <nodakai@gmail.com>
|
|
|
|
|
|
|
|
Refactor to use `debug_struct` in several Debug impls
Also use `pad` and derive `Debug` for `Edge`.
Fixes #44771.
|
|
Fixes #44771.
|
|
|
|
These show up in rustdoc so need to be correct.
|
|
Fixes #24372
|
|
These were found by running tidy on stable versions of rust and finding
features stabilised with the wrong version numbers.
|
|
|
|
Also remove some unnecessary unsafe impl from the tests.
|
|
Presumably `N` was supposed to be used in both places.
|
|
|
|
Fix typo in mutex.rs docs
This seems to match other uses of "be accessed" in the document.
|
|
This seems to match other uses of "be accessed" in the document.
|
|
This was never established as a convention we should follow in the 'More
API Documentation Conventions' RFC:
https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
|
|
|
|
The versions show up in rustdoc.
|
|
|
|
CC #34761
|
|
Part of https://github.com/rust-lang/rust/issues/31869.
Also turn on the `missing_debug_implementations` lint at the crate
level.
|
|
Also, end sentence with a period.
|
|
|
|
|
|
|
|
|
|
This primarily removes a lot of `sync::Static*` APIs and rejiggers the
associated implementations. While doing this it was discovered that the
`is_poisoned` method can actually result in a data race for the Mutex/RwLock
primitives, so the inner `Cell<bool>` was changed to an `AtomicBool` to prevent
the associated data race. Otherwise the usage/gurantees should be the same
they were before.
|