Skip to content

Commit 7cb5180

Browse files
authored
Rollup merge of rust-lang#5420 - dtolnay:newret, r=flip1995
Downgrade new_ret_no_self to pedantic As motivated by rust-lang#5418. This is the second most widely suppressed Clippy style lint, and [this grep.app search](https://grep.app/search?q=%5C%5Ballow%5C%28.%2Aclippy%3A%3Anew_ret_no_self%5Cb&regexp=true&case=true&filter[lang][0]=Rust) shows a large number of diverse reasonable signatures for a `new` method. changelog: Remove new_ret_no_self from default set of enabled lints
2 parents 2011d9a + 560c8c9 commit 7cb5180

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11151115
LintId::of(&methods::FIND_MAP),
11161116
LintId::of(&methods::INEFFICIENT_TO_STRING),
11171117
LintId::of(&methods::MAP_FLATTEN),
1118+
LintId::of(&methods::NEW_RET_NO_SELF),
11181119
LintId::of(&methods::OPTION_MAP_UNWRAP_OR),
11191120
LintId::of(&methods::OPTION_MAP_UNWRAP_OR_ELSE),
11201121
LintId::of(&methods::RESULT_MAP_UNWRAP_OR_ELSE),
@@ -1276,7 +1277,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
12761277
LintId::of(&methods::ITER_NTH_ZERO),
12771278
LintId::of(&methods::ITER_SKIP_NEXT),
12781279
LintId::of(&methods::MANUAL_SATURATING_ARITHMETIC),
1279-
LintId::of(&methods::NEW_RET_NO_SELF),
12801280
LintId::of(&methods::OK_EXPECT),
12811281
LintId::of(&methods::OPTION_AND_THEN_SOME),
12821282
LintId::of(&methods::OPTION_AS_REF_DEREF),
@@ -1457,7 +1457,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14571457
LintId::of(&methods::ITER_NTH_ZERO),
14581458
LintId::of(&methods::ITER_SKIP_NEXT),
14591459
LintId::of(&methods::MANUAL_SATURATING_ARITHMETIC),
1460-
LintId::of(&methods::NEW_RET_NO_SELF),
14611460
LintId::of(&methods::OK_EXPECT),
14621461
LintId::of(&methods::OPTION_MAP_OR_NONE),
14631462
LintId::of(&methods::RESULT_MAP_OR_INTO_OPTION),

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ declare_clippy_lint! {
748748
/// }
749749
/// ```
750750
pub NEW_RET_NO_SELF,
751-
style,
751+
pedantic,
752752
"not returning `Self` in a `new` method"
753753
}
754754

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
14471447
},
14481448
Lint {
14491449
name: "new_ret_no_self",
1450-
group: "style",
1450+
group: "pedantic",
14511451
desc: "not returning `Self` in a `new` method",
14521452
deprecation: None,
14531453
module: "methods",

0 commit comments

Comments
 (0)