Change from correctness to style and MaybeIncorrect instead of MachineApplicable

This commit is contained in:
Francis Murillo 2020-10-18 09:09:07 +08:00
parent 292cb9bfb6
commit e7e03b7912
3 changed files with 4 additions and 4 deletions

View File

@ -1621,6 +1621,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&misc_early::DUPLICATE_UNDERSCORE_ARGUMENT),
LintId::of(&misc_early::MIXED_CASE_HEX_LITERALS),
LintId::of(&misc_early::REDUNDANT_PATTERN),
LintId::of(&mut_mutex_lock::MUT_MUTEX_LOCK),
LintId::of(&mut_reference::UNNECESSARY_MUT_PASSED),
LintId::of(&neg_multiply::NEG_MULTIPLY),
LintId::of(&new_without_default::NEW_WITHOUT_DEFAULT),
@ -1784,7 +1785,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&misc::FLOAT_CMP),
LintId::of(&misc::MODULO_ONE),
LintId::of(&mut_key::MUTABLE_KEY_TYPE),
LintId::of(&mut_mutex_lock::MUT_MUTEX_LOCK),
LintId::of(&open_options::NONSENSICAL_OPEN_OPTIONS),
LintId::of(&option_env_unwrap::OPTION_ENV_UNWRAP),
LintId::of(&ptr::MUT_FROM_REF),

View File

@ -38,7 +38,7 @@
/// *value += 1;
/// ```
pub MUT_MUTEX_LOCK,
correctness,
style,
"`&mut Mutex::lock` does unnecessary locking"
}
@ -60,7 +60,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, ex: &'tcx Expr<'tcx>) {
"calling `&mut Mutex::lock` unnecessarily locks an exclusive (mutable) reference",
"change this to",
"get_mut".to_owned(),
Applicability::MachineApplicable,
Applicability::MaybeIncorrect,
);
}
}

View File

@ -1504,7 +1504,7 @@
},
Lint {
name: "mut_mutex_lock",
group: "correctness",
group: "style",
desc: "`&mut Mutex::lock` does unnecessary locking",
deprecation: None,
module: "mut_mutex_lock",