Rollup merge of #5420 - dtolnay:newret, r=flip1995

Downgrade new_ret_no_self to pedantic

As motivated by #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
This commit is contained in:
Philipp Krones 2020-04-08 15:50:24 +02:00 committed by GitHub
commit 7cb5180dfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View file

@ -1115,6 +1115,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&methods::FIND_MAP),
LintId::of(&methods::INEFFICIENT_TO_STRING),
LintId::of(&methods::MAP_FLATTEN),
LintId::of(&methods::NEW_RET_NO_SELF),
LintId::of(&methods::OPTION_MAP_UNWRAP_OR),
LintId::of(&methods::OPTION_MAP_UNWRAP_OR_ELSE),
LintId::of(&methods::RESULT_MAP_UNWRAP_OR_ELSE),
@ -1276,7 +1277,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&methods::ITER_NTH_ZERO),
LintId::of(&methods::ITER_SKIP_NEXT),
LintId::of(&methods::MANUAL_SATURATING_ARITHMETIC),
LintId::of(&methods::NEW_RET_NO_SELF),
LintId::of(&methods::OK_EXPECT),
LintId::of(&methods::OPTION_AND_THEN_SOME),
LintId::of(&methods::OPTION_AS_REF_DEREF),
@ -1457,7 +1457,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&methods::ITER_NTH_ZERO),
LintId::of(&methods::ITER_SKIP_NEXT),
LintId::of(&methods::MANUAL_SATURATING_ARITHMETIC),
LintId::of(&methods::NEW_RET_NO_SELF),
LintId::of(&methods::OK_EXPECT),
LintId::of(&methods::OPTION_MAP_OR_NONE),
LintId::of(&methods::RESULT_MAP_OR_INTO_OPTION),

View file

@ -748,7 +748,7 @@ declare_clippy_lint! {
/// }
/// ```
pub NEW_RET_NO_SELF,
style,
pedantic,
"not returning `Self` in a `new` method"
}

View file

@ -1447,7 +1447,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
},
Lint {
name: "new_ret_no_self",
group: "style",
group: "pedantic",
desc: "not returning `Self` in a `new` method",
deprecation: None,
module: "methods",