Skip to content

Commit 5449e23

Browse files
committed
Auto merge of rust-lang#7568 - dtolnay-contrib:ifletelse, r=llogiq
Downgrade option_if_let_else to nursery I believe that this lint's loose understanding of ownership (rust-lang#5822, rust-lang#6737) makes it unsuitable to be enabled by default in its current state, even as a pedantic lint. Additionally the lint has known problems with type inference (rust-lang#6137), though I may be willing to consider this a non-blocker in isolation if it weren't for the ownership false positives. A fourth false positive involving const fn: rust-lang#7567. But on top of these, for me the biggest issue is I basically fully agree with rust-lang/rust-clippy#6137 (comment). In my experience this lint universally makes code worse even when the resulting code does compile. --- changelog: remove [`option_if_let_else`] from default set of enabled lints
2 parents 7c5487d + 3c8eaa8 commit 5449e23

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11251125
LintId::of(needless_for_each::NEEDLESS_FOR_EACH),
11261126
LintId::of(needless_pass_by_value::NEEDLESS_PASS_BY_VALUE),
11271127
LintId::of(non_expressive_names::SIMILAR_NAMES),
1128-
LintId::of(option_if_let_else::OPTION_IF_LET_ELSE),
11291128
LintId::of(pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE),
11301129
LintId::of(pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF),
11311130
LintId::of(ranges::RANGE_MINUS_ONE),
@@ -1802,6 +1801,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
18021801
LintId::of(mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL),
18031802
LintId::of(mutex_atomic::MUTEX_INTEGER),
18041803
LintId::of(nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES),
1804+
LintId::of(option_if_let_else::OPTION_IF_LET_ELSE),
18051805
LintId::of(path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),
18061806
LintId::of(redundant_pub_crate::REDUNDANT_PUB_CRATE),
18071807
LintId::of(regex::TRIVIAL_REGEX),

clippy_lints/src/option_if_let_else.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ declare_clippy_lint! {
5757
/// }, |foo| foo);
5858
/// ```
5959
pub OPTION_IF_LET_ELSE,
60-
pedantic,
60+
nursery,
6161
"reimplementation of Option::map_or"
6262
}
6363

0 commit comments

Comments
 (0)