-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
Description
The unused_must_use
lint doesn't tell you which type needs to be used. This can get confusing if multiple must_use
types are involved, especially because the language used includes the word “result”:
This code:
#[must_use]
struct A;
fn a() -> Result<A, ()> {
Ok(A)
}
fn main() {
a().unwrap();
}
Results in:
warning: unused result which must be used
--> <anon>:9:5
|
9 | a().unwrap();
| ^^^^^^^^^^^^^
Suggested message: unused [TYPE] which must be used
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.