about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-02-21 15:33:50 +0000
committerbors <bors@rust-lang.org>2021-02-21 15:33:50 +0000
commit8a47901bac1550982fb4e1a63faed513c72d5266 (patch)
tree67630a46f4cafb6b5b3f80ba935c206d0ebaadad
parentd2ddf9c79602e54e535649fa13ffa41c25c3508a (diff)
parent46c91db1e1c1f497854069d78e522bc5ff6bf0f7 (diff)
downloadrust-8a47901bac1550982fb4e1a63faed513c72d5266.tar.gz
rust-8a47901bac1550982fb4e1a63faed513c72d5266.zip
Auto merge of #6765 - camsteffen:unnecessary-wraps-pedantic, r=flip1995
Change unnecessary_wraps to pedantic

changelog: Change unnecessary_wraps to pedantic

There seems to be enough evidence that this lint is not wanted as warn-by-default. Attempted before at #6380. False positives at #6721 and #6427. Actually requested to change the category at #6726.

Closes #6726
-rw-r--r--clippy_lints/src/lib.rs3
-rw-r--r--clippy_lints/src/unnecessary_wraps.rs6
2 files changed, 4 insertions, 5 deletions
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 67e490584e8..2e0bc4de801 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -1396,6 +1396,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         LintId::of(&types::PTR_AS_PTR),
         LintId::of(&unicode::NON_ASCII_LITERAL),
         LintId::of(&unicode::UNICODE_NOT_NFC),
+        LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
         LintId::of(&unnested_or_patterns::UNNESTED_OR_PATTERNS),
         LintId::of(&unused_self::UNUSED_SELF),
         LintId::of(&wildcard_imports::ENUM_GLOB_USE),
@@ -1690,7 +1691,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
         LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
         LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
-        LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
         LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
         LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
         LintId::of(&unused_unit::UNUSED_UNIT),
@@ -1908,7 +1908,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         LintId::of(&types::UNNECESSARY_CAST),
         LintId::of(&types::VEC_BOX),
         LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
-        LintId::of(&unnecessary_wraps::UNNECESSARY_WRAPS),
         LintId::of(&unwrap::UNNECESSARY_UNWRAP),
         LintId::of(&useless_conversion::USELESS_CONVERSION),
         LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),
diff --git a/clippy_lints/src/unnecessary_wraps.rs b/clippy_lints/src/unnecessary_wraps.rs
index 607585125a4..1e58576d059 100644
--- a/clippy_lints/src/unnecessary_wraps.rs
+++ b/clippy_lints/src/unnecessary_wraps.rs
@@ -17,8 +17,8 @@ declare_clippy_lint! {
     ///
     /// **Why is this bad?** It is not meaningful to wrap values when no `None` or `Err` is returned.
     ///
-    /// **Known problems:** Since this lint changes function type signature, you may need to
-    /// adjust some code at callee side.
+    /// **Known problems:** There can be false positives if the function signature is designed to
+    /// fit some external requirement.
     ///
     /// **Example:**
     ///
@@ -48,7 +48,7 @@ declare_clippy_lint! {
     /// }
     /// ```
     pub UNNECESSARY_WRAPS,
-    complexity,
+    pedantic,
     "functions that only return `Ok` or `Some`"
 }