mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
Move return_self_not_must_use
to pedantic
This commit is contained in:
parent
d364d8ad5b
commit
2d3eb5082a
6 changed files with 6 additions and 6 deletions
|
@ -250,7 +250,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
|
||||||
LintId::of(reference::REF_IN_DEREF),
|
LintId::of(reference::REF_IN_DEREF),
|
||||||
LintId::of(regex::INVALID_REGEX),
|
LintId::of(regex::INVALID_REGEX),
|
||||||
LintId::of(repeat_once::REPEAT_ONCE),
|
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::LET_AND_RETURN),
|
||||||
LintId::of(returns::NEEDLESS_RETURN),
|
LintId::of(returns::NEEDLESS_RETURN),
|
||||||
LintId::of(self_assignment::SELF_ASSIGNMENT),
|
LintId::of(self_assignment::SELF_ASSIGNMENT),
|
||||||
|
|
|
@ -81,6 +81,7 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
|
||||||
LintId::of(ranges::RANGE_PLUS_ONE),
|
LintId::of(ranges::RANGE_PLUS_ONE),
|
||||||
LintId::of(redundant_else::REDUNDANT_ELSE),
|
LintId::of(redundant_else::REDUNDANT_ELSE),
|
||||||
LintId::of(ref_option_ref::REF_OPTION_REF),
|
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(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED),
|
||||||
LintId::of(strings::STRING_ADD_ASSIGN),
|
LintId::of(strings::STRING_ADD_ASSIGN),
|
||||||
LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
|
LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
|
||||||
|
|
|
@ -16,7 +16,6 @@ store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec!
|
||||||
LintId::of(methods::SUSPICIOUS_MAP),
|
LintId::of(methods::SUSPICIOUS_MAP),
|
||||||
LintId::of(mut_key::MUTABLE_KEY_TYPE),
|
LintId::of(mut_key::MUTABLE_KEY_TYPE),
|
||||||
LintId::of(octal_escapes::OCTAL_ESCAPES),
|
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_ARITHMETIC_IMPL),
|
||||||
LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
|
LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
|
||||||
])
|
])
|
||||||
|
|
|
@ -60,7 +60,7 @@ declare_clippy_lint! {
|
||||||
/// ```
|
/// ```
|
||||||
#[clippy::version = "1.59.0"]
|
#[clippy::version = "1.59.0"]
|
||||||
pub RETURN_SELF_NOT_MUST_USE,
|
pub RETURN_SELF_NOT_MUST_USE,
|
||||||
suspicious,
|
pedantic,
|
||||||
"missing `#[must_use]` annotation on a method returning `Self`"
|
"missing `#[must_use]` annotation on a method returning `Self`"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
#![warn(clippy::return_self_not_must_use)]
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Bar;
|
pub struct Bar;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error: missing `#[must_use]` attribute on a method returning `Self`
|
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;
|
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
|
= 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`
|
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 | / pub fn foo(&self) -> Self {
|
||||||
LL | | Self
|
LL | | Self
|
||||||
|
@ -18,7 +18,7 @@ LL | | }
|
||||||
= help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
|
= 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`
|
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 | / pub fn bar(self) -> Self {
|
||||||
LL | | self
|
LL | | self
|
||||||
|
|
Loading…
Reference in a new issue