From 78b4dfc57cffd96c5f48b0bc0b350066ab1d0ceb Mon Sep 17 00:00:00 2001 From: Krishna Veera Reddy Date: Wed, 18 Dec 2019 22:15:55 -0800 Subject: [PATCH] Move `mem_replace_with_default` out of nursery --- clippy_lints/src/lib.rs | 3 ++- clippy_lints/src/mem_replace.rs | 2 +- src/lintlist/mod.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index abcddc885..3aace1171 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1183,6 +1183,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf LintId::of(&matches::SINGLE_MATCH), LintId::of(&mem_discriminant::MEM_DISCRIMINANT_NON_ENUM), LintId::of(&mem_replace::MEM_REPLACE_OPTION_WITH_NONE), + LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT), LintId::of(&mem_replace::MEM_REPLACE_WITH_UNINIT), LintId::of(&methods::CHARS_LAST_CMP), LintId::of(&methods::CHARS_NEXT_CMP), @@ -1370,6 +1371,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf LintId::of(&matches::MATCH_WILD_ERR_ARM), LintId::of(&matches::SINGLE_MATCH), LintId::of(&mem_replace::MEM_REPLACE_OPTION_WITH_NONE), + LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT), LintId::of(&methods::CHARS_LAST_CMP), LintId::of(&methods::INTO_ITER_ON_REF), LintId::of(&methods::ITER_CLONED_COLLECT), @@ -1595,7 +1597,6 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![ LintId::of(&attrs::EMPTY_LINE_AFTER_OUTER_ATTR), LintId::of(&fallible_impl_from::FALLIBLE_IMPL_FROM), - LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT), LintId::of(&missing_const_for_fn::MISSING_CONST_FOR_FN), LintId::of(&mul_add::MANUAL_MUL_ADD), LintId::of(&mutex_atomic::MUTEX_INTEGER), diff --git a/clippy_lints/src/mem_replace.rs b/clippy_lints/src/mem_replace.rs index ab0bdb4d0..3405ccf06 100644 --- a/clippy_lints/src/mem_replace.rs +++ b/clippy_lints/src/mem_replace.rs @@ -87,7 +87,7 @@ declare_clippy_lint! { /// let taken = std::mem::take(&mut text); /// ``` pub MEM_REPLACE_WITH_DEFAULT, - nursery, + style, "replacing a value of type `T` with `T::default()` instead of using `std::mem::take`" } diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs index 4b820250c..c396c3ab8 100644 --- a/src/lintlist/mod.rs +++ b/src/lintlist/mod.rs @@ -1101,7 +1101,7 @@ pub const ALL_LINTS: [Lint; 342] = [ }, Lint { name: "mem_replace_with_default", - group: "nursery", + group: "style", desc: "replacing a value of type `T` with `T::default()` instead of using `std::mem::take`", deprecation: None, module: "mem_replace",