mirror of
https://github.com/torvalds/linux.git
synced 2025-11-01 17:18:25 +02:00
The `Lock::try_lock()` function returns an `Option<Guard<...>>`, but it currently does not issue a warning if the return value is unused. To avoid potential bugs, the `#[must_use]` annotation is added to ensure proper usage. Note that `T` is `#[must_use]` but `Option<T>` is not. For more context, see: https://github.com/rust-lang/rust/issues/71368. Suggested-by: Alice Ryhl <aliceryhl@google.com> Link: https://github.com/Rust-for-Linux/linux/issues/1133 Signed-off-by: Jason Devers <dev.json2@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Link: https://lore.kernel.org/r/20241212154753.139563-1-dev.json2@gmail.com |
||
|---|---|---|
| .. | ||
| arc | ||
| lock | ||
| arc.rs | ||
| condvar.rs | ||
| lock.rs | ||
| locked_by.rs | ||
| poll.rs | ||
| rcu.rs | ||