Skip to content

Commit 72c59fd

Browse files
committed
Auto merge of #8302 - xFrednet:0000-move-return-self-not-must-use, r=flip1995
Move `return_self_not_must_use` to `pedantic` r? `@flip1995` changelog: none
2 parents d364d8a + 2d3eb50 commit 72c59fd

6 files changed

+6
-6
lines changed

Diff for: clippy_lints/src/lib.register_all.rs

-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
250250
LintId::of(reference::REF_IN_DEREF),
251251
LintId::of(regex::INVALID_REGEX),
252252
LintId::of(repeat_once::REPEAT_ONCE),
253-
LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
254253
LintId::of(returns::LET_AND_RETURN),
255254
LintId::of(returns::NEEDLESS_RETURN),
256255
LintId::of(self_assignment::SELF_ASSIGNMENT),

Diff for: clippy_lints/src/lib.register_pedantic.rs

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
8181
LintId::of(ranges::RANGE_PLUS_ONE),
8282
LintId::of(redundant_else::REDUNDANT_ELSE),
8383
LintId::of(ref_option_ref::REF_OPTION_REF),
84+
LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
8485
LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED),
8586
LintId::of(strings::STRING_ADD_ASSIGN),
8687
LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),

Diff for: clippy_lints/src/lib.register_suspicious.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec!
1616
LintId::of(methods::SUSPICIOUS_MAP),
1717
LintId::of(mut_key::MUTABLE_KEY_TYPE),
1818
LintId::of(octal_escapes::OCTAL_ESCAPES),
19-
LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
2019
LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
2120
LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
2221
])

Diff for: clippy_lints/src/return_self_not_must_use.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ declare_clippy_lint! {
6060
/// ```
6161
#[clippy::version = "1.59.0"]
6262
pub RETURN_SELF_NOT_MUST_USE,
63-
suspicious,
63+
pedantic,
6464
"missing `#[must_use]` annotation on a method returning `Self`"
6565
}
6666

Diff for: tests/ui/return_self_not_must_use.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![crate_type = "lib"]
2+
#![warn(clippy::return_self_not_must_use)]
23

34
#[derive(Clone)]
45
pub struct Bar;

Diff for: tests/ui/return_self_not_must_use.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: missing `#[must_use]` attribute on a method returning `Self`
2-
--> $DIR/return_self_not_must_use.rs:7:5
2+
--> $DIR/return_self_not_must_use.rs:8:5
33
|
44
LL | fn what(&self) -> Self;
55
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | fn what(&self) -> Self;
88
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
99

1010
error: missing `#[must_use]` attribute on a method returning `Self`
11-
--> $DIR/return_self_not_must_use.rs:17:5
11+
--> $DIR/return_self_not_must_use.rs:18:5
1212
|
1313
LL | / pub fn foo(&self) -> Self {
1414
LL | | Self
@@ -18,7 +18,7 @@ LL | | }
1818
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
1919

2020
error: missing `#[must_use]` attribute on a method returning `Self`
21-
--> $DIR/return_self_not_must_use.rs:20:5
21+
--> $DIR/return_self_not_must_use.rs:21:5
2222
|
2323
LL | / pub fn bar(self) -> Self {
2424
LL | | self

0 commit comments

Comments
 (0)