]> git.lizzy.rs Git - rust.git/commitdiff
Move `return_self_not_must_use` to `pedantic`
authorxFrednet <xFrednet@gmail.com>
Mon, 17 Jan 2022 11:25:38 +0000 (12:25 +0100)
committerxFrednet <xFrednet@gmail.com>
Mon, 17 Jan 2022 11:35:19 +0000 (12:35 +0100)
clippy_lints/src/lib.register_all.rs
clippy_lints/src/lib.register_pedantic.rs
clippy_lints/src/lib.register_suspicious.rs
clippy_lints/src/return_self_not_must_use.rs
tests/ui/return_self_not_must_use.rs
tests/ui/return_self_not_must_use.stderr

index eba51099496f0584385ce969b605a119c2929aad..87fd7f99748a1df8d1b00018e7e7b1c09d55a68d 100644 (file)
     LintId::of(reference::REF_IN_DEREF),
     LintId::of(regex::INVALID_REGEX),
     LintId::of(repeat_once::REPEAT_ONCE),
-    LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
     LintId::of(returns::LET_AND_RETURN),
     LintId::of(returns::NEEDLESS_RETURN),
     LintId::of(self_assignment::SELF_ASSIGNMENT),
index 1744b7c825078e40ed37210384bb3cda7a4d0409..1292675f4a96cde9b178869674b143c6e5038907 100644 (file)
@@ -81,6 +81,7 @@
     LintId::of(ranges::RANGE_PLUS_ONE),
     LintId::of(redundant_else::REDUNDANT_ELSE),
     LintId::of(ref_option_ref::REF_OPTION_REF),
+    LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
     LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED),
     LintId::of(strings::STRING_ADD_ASSIGN),
     LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
index 8594338ffa5ab5558dfb2ae26a4eb7f6e831f08a..10f8ae4b7f7fca8583cde6a976955579a3efc4e1 100644 (file)
@@ -16,7 +16,6 @@
     LintId::of(methods::SUSPICIOUS_MAP),
     LintId::of(mut_key::MUTABLE_KEY_TYPE),
     LintId::of(octal_escapes::OCTAL_ESCAPES),
-    LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
     LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
     LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
 ])
index 5dafd08cf3be0e754b8d9e1d29b4076a2a5c5448..79f104eac0be24c9e5b55e719021af891613471a 100644 (file)
@@ -60,7 +60,7 @@
     /// ```
     #[clippy::version = "1.59.0"]
     pub RETURN_SELF_NOT_MUST_USE,
-    suspicious,
+    pedantic,
     "missing `#[must_use]` annotation on a method returning `Self`"
 }
 
index 7dd5742dae9f213d5038af6d0422b6b201342db6..9b33ad6d3f6b3f83b26ca2ab4384bea9ee60cf51 100644 (file)
@@ -1,4 +1,5 @@
 #![crate_type = "lib"]
+#![warn(clippy::return_self_not_must_use)]
 
 #[derive(Clone)]
 pub struct Bar;
index 8af10cb65c40670202da1fd459fea989382ccafc..94be87dfa31c73c85a57a262c203d162252cc098 100644 (file)
@@ -1,5 +1,5 @@
 error: missing `#[must_use]` attribute on a method returning `Self`
-  --> $DIR/return_self_not_must_use.rs:7:5
+  --> $DIR/return_self_not_must_use.rs:8:5
    |
 LL |     fn what(&self) -> Self;
    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL |     fn what(&self) -> Self;
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
 
 error: missing `#[must_use]` attribute on a method returning `Self`
-  --> $DIR/return_self_not_must_use.rs:17:5
+  --> $DIR/return_self_not_must_use.rs:18:5
    |
 LL | /     pub fn foo(&self) -> Self {
 LL | |         Self
@@ -18,7 +18,7 @@ LL | |     }
    = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
 
 error: missing `#[must_use]` attribute on a method returning `Self`
-  --> $DIR/return_self_not_must_use.rs:20:5
+  --> $DIR/return_self_not_must_use.rs:21:5
    |
 LL | /     pub fn bar(self) -> Self {
 LL | |         self