-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingE-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't haveT-middleType: Probably requires verifiying typesType: Probably requires verifiying types
Description
fn main() {
let _: () = f();
}
fn f<T: Default>() -> T {
T::default()
}
warning: this let-binding has unit value. Consider omitting `let _ =`, #[warn(let_unit_value)] on by default
--> src/main.rs:2:5
|
2 | let _: () = f();
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#let_unit_value
Maybe this specific case would be clearer with f::<()>()
but I consider this a false positive. Came up in serde_json unit tests where we test that serde_json::from_str can parse various representations of ().
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingE-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't haveT-middleType: Probably requires verifiying typesType: Probably requires verifiying types