Skip to content

Commit 8cf8bef

Browse files
xFrednetMark-Simulacrum
authored andcommitted
Move return_self_not_must_use to pedantic
1 parent 6af5faf commit 8cf8bef

6 files changed

+6
-6
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
247247
LintId::of(reference::REF_IN_DEREF),
248248
LintId::of(regex::INVALID_REGEX),
249249
LintId::of(repeat_once::REPEAT_ONCE),
250-
LintId::of(return_self_not_must_use::RETURN_SELF_NOT_MUST_USE),
251250
LintId::of(returns::LET_AND_RETURN),
252251
LintId::of(returns::NEEDLESS_RETURN),
253252
LintId::of(self_assignment::SELF_ASSIGNMENT),

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

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

Diff for: src/tools/clippy/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: src/tools/clippy/clippy_lints/src/return_self_not_must_use.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ declare_clippy_lint! {
3838
/// ```
3939
#[clippy::version = "1.59.0"]
4040
pub RETURN_SELF_NOT_MUST_USE,
41-
suspicious,
41+
pedantic,
4242
"missing `#[must_use]` annotation on a method returning `Self`"
4343
}
4444

Diff for: src/tools/clippy/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: src/tools/clippy/tests/ui/return_self_not_must_use.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
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
| ^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::return-self-not-must-use` implied by `-D warnings`
88

99
error: missing `#[must_use]` attribute on a method returning `Self`
10-
--> $DIR/return_self_not_must_use.rs:17:5
10+
--> $DIR/return_self_not_must_use.rs:18:5
1111
|
1212
LL | / pub fn foo(&self) -> Self {
1313
LL | | Self
1414
LL | | }
1515
| |_____^
1616

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

0 commit comments

Comments
 (0)