From e7e03b791217645d48e407b28ed023723cedb24c Mon Sep 17 00:00:00 2001 From: Francis Murillo Date: Sun, 18 Oct 2020 09:09:07 +0800 Subject: [PATCH] Change from correctness to style and MaybeIncorrect instead of MachineApplicable --- clippy_lints/src/lib.rs | 2 +- clippy_lints/src/mut_mutex_lock.rs | 4 ++-- src/lintlist/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 648c65ef7b0..9d88cc22d10 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -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), diff --git a/clippy_lints/src/mut_mutex_lock.rs b/clippy_lints/src/mut_mutex_lock.rs index 82ed2d6d69c..df1cecb328c 100644 --- a/clippy_lints/src/mut_mutex_lock.rs +++ b/clippy_lints/src/mut_mutex_lock.rs @@ -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, ); } } diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs index 5e48757a4c5..25ede21da77 100644 --- a/src/lintlist/mod.rs +++ b/src/lintlist/mod.rs @@ -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",