Allow let_underscore_drop
and let_underscore_must_use
by default.
These lints are very noisy and are allow-by-default in clippy anyways. Hence, setting them to allow-by-default here makes more sense than warning constantly on these cases.
This commit is contained in:
parent
36b6309c65
commit
ae2ac3b4c5
@ -41,7 +41,7 @@
|
||||
/// calling `std::mem::drop` on the expression is clearer and helps convey
|
||||
/// intent.
|
||||
pub LET_UNDERSCORE_DROP,
|
||||
Warn,
|
||||
Allow,
|
||||
"non-binding let on a type that implements `Drop`"
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
/// expression to immediately drop. Usually, it's better to explicitly handle
|
||||
/// the `must_use` expression.
|
||||
pub LET_UNDERSCORE_MUST_USE,
|
||||
Warn,
|
||||
Allow,
|
||||
"non-binding let on a expression marked `must_use`"
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
// run-pass
|
||||
// compile-flags: -W let_underscore_drop
|
||||
|
||||
struct NontrivialDrop;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
warning: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/let_underscore_drop.rs:12:5
|
||||
--> $DIR/let_underscore_drop.rs:13:5
|
||||
|
|
||||
LL | let _ = NontrivialDrop;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(let_underscore_drop)]` on by default
|
||||
= note: requested on the command line with `-W let-underscore-drop`
|
||||
= help: consider binding to an unused variable
|
||||
= help: consider explicitly droping with `std::mem::drop`
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
// run-pass
|
||||
// compile-flags: -W let_underscore_must_use
|
||||
|
||||
#[must_use]
|
||||
struct MustUseType;
|
||||
|
@ -1,15 +1,15 @@
|
||||
warning: non-binding let on a expression marked `must_use`
|
||||
--> $DIR/let_underscore_must_use.rs:10:5
|
||||
--> $DIR/let_underscore_must_use.rs:11:5
|
||||
|
|
||||
LL | let _ = MustUseType;
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(let_underscore_must_use)]` on by default
|
||||
= note: requested on the command line with `-W let-underscore-must-use`
|
||||
= help: consider binding to an unused variable
|
||||
= help: consider explicitly droping with `std::mem::drop`
|
||||
|
||||
warning: non-binding let on a expression marked `must_use`
|
||||
--> $DIR/let_underscore_must_use.rs:11:5
|
||||
--> $DIR/let_underscore_must_use.rs:12:5
|
||||
|
|
||||
LL | let _ = must_use_function();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user