1
Fork 0

Add let_underscore_must_use lint.

Similar to `let_underscore_drop`, this lint checks for statements similar
to `let _ = foo`, where `foo` is an expression marked `must_use`.
This commit is contained in:
Aaron Kofsky 2022-06-02 14:58:44 -04:00
parent ad7587fedc
commit 758a9fd0f9
4 changed files with 143 additions and 3 deletions

View file

@ -317,7 +317,12 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {
REDUNDANT_SEMICOLONS
);
add_lint_group!("let_underscore", LET_UNDERSCORE_DROP, LET_UNDERSCORE_LOCK);
add_lint_group!(
"let_underscore",
LET_UNDERSCORE_DROP,
LET_UNDERSCORE_LOCK,
LET_UNDERSCORE_MUST_USE
);
add_lint_group!(
"rust_2018_idioms",