Skip to content

Commit 1f39eeb

Browse files
authored
Rollup merge of rust-lang#5705 - dtolnay:orpat, r=flip1995
Downgrade unnested_or_patterns to pedantic Even with rust-lang#5704 fixed, I don't believe it is a safe bet that if someone is using or-patterns anywhere in a codebase then they want to use it as much as possible in the whole codebase. I think it would be reasonable to reevaluate after the feature is stable. I feel that a warn-by-default lint suggesting use of an unstable feature, even if already being used in one place, is questionable. changelog: Remove unnested_or_patterns from default set of enabled lints
2 parents 7c61be6 + 56f25e3 commit 1f39eeb

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

clippy_lints/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11871187
LintId::of(&types::OPTION_OPTION),
11881188
LintId::of(&unicode::NON_ASCII_LITERAL),
11891189
LintId::of(&unicode::UNICODE_NOT_NFC),
1190+
LintId::of(&unnested_or_patterns::UNNESTED_OR_PATTERNS),
11901191
LintId::of(&unused_self::UNUSED_SELF),
11911192
LintId::of(&wildcard_imports::ENUM_GLOB_USE),
11921193
LintId::of(&wildcard_imports::WILDCARD_IMPORTS),
@@ -1440,7 +1441,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14401441
LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
14411442
LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
14421443
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
1443-
LintId::of(&unnested_or_patterns::UNNESTED_OR_PATTERNS),
14441444
LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
14451445
LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
14461446
LintId::of(&unwrap::PANICKING_UNWRAP),
@@ -1624,7 +1624,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
16241624
LintId::of(&types::UNNECESSARY_CAST),
16251625
LintId::of(&types::VEC_BOX),
16261626
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
1627-
LintId::of(&unnested_or_patterns::UNNESTED_OR_PATTERNS),
16281627
LintId::of(&unwrap::UNNECESSARY_UNWRAP),
16291628
LintId::of(&useless_conversion::USELESS_CONVERSION),
16301629
LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),

clippy_lints/src/unnested_or_patterns.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ declare_clippy_lint! {
4545
/// }
4646
/// ```
4747
pub UNNESTED_OR_PATTERNS,
48-
complexity,
48+
pedantic,
4949
"unnested or-patterns, e.g., `Foo(Bar) | Foo(Baz) instead of `Foo(Bar | Baz)`"
5050
}
5151

src/lintlist/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
23292329
},
23302330
Lint {
23312331
name: "unnested_or_patterns",
2332-
group: "complexity",
2332+
group: "pedantic",
23332333
desc: "unnested or-patterns, e.g., `Foo(Bar) | Foo(Baz) instead of `Foo(Bar | Baz)`",
23342334
deprecation: None,
23352335
module: "unnested_or_patterns",

0 commit comments

Comments
 (0)