https://github.com/rust-lang/rust/blob/master/src/libstd/sys/common/poison.rs#L172
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
TryLockError::Poisoned(..) => "poisoned lock: another task failed inside",
TryLockError::WouldBlock => "try_lock failed because the operation would block"
}.fmt(f)
}
Method call on a statement-like match
Typically used for replacing self
in macros.
This includes u8
- If a path like
u32::some_name
is seen, if the moduleu32
exists in the current scope andsome_name
is an item in that module - Treat the path as
self::u32::some_name
- Otherwise, treat it as
<u32 as ?>::some_name
Unconfirmed
<Foo>::SOMECONST
can either refer to impl Foo { const SOMECONST... } or
impl Trait for Foo { const SOMECONST ... }`
- This includes any function call (or method call)
- TODO: Is this just the last statement? or all statements
- Only the values used are moved, which can lead to the source not being moved (if all used values are Copy)
- This only really shows up with some edge cases where the RHS is inferred
- E.g.
None as Option<Span>
is perfectly valid, and is the same asNone::<Span>