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:
parent
821b32bd40
commit
ad7587fedc
4 changed files with 91 additions and 3 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue