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.
/// 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`"
}
/// 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`"
}
// run-pass
+// compile-flags: -W let_underscore_drop
struct NontrivialDrop;
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`
// run-pass
+// compile-flags: -W let_underscore_must_use
#[must_use]
struct MustUseType;
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();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^