Add let_underscore_lock lint.
Similar to `let_underscore_drop`, this lint checks for statements similar to `let _ = foo`, where `foo` is a lock guard. These types of let statements are especially problematic because the lock gets released immediately, instead of at the end of the scope. This behavior is almost always the wrong thing.
This commit is contained in:
@@ -317,7 +317,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {
|
||||
REDUNDANT_SEMICOLONS
|
||||
);
|
||||
|
||||
add_lint_group!("let_underscore", LET_UNDERSCORE_DROP);
|
||||
add_lint_group!("let_underscore", LET_UNDERSCORE_DROP, LET_UNDERSCORE_LOCK);
|
||||
|
||||
add_lint_group!(
|
||||
"rust_2018_idioms",
|
||||
|
||||
Reference in New Issue
Block a user