Auto merge of #5563 - ThibsG:MergeLints, r=flip1995
Merge some lints together This PR merges following lints: - `block_in_if_condition_expr` and `block_in_if_condition_stmt` → `blocks_in_if_conditions` - `option_map_unwrap_or`, `option_map_unwrap_or_else` and `result_map_unwrap_or_else` → `map_unwrap` - `option_unwrap_used` and `result_unwrap_used` → `unwrap_used` - `option_expect_used` and `result_expect_used` → `expect_used` - `wrong_pub_self_convention` into `wrong_self_convention` - `for_loop_over_option` and `for_loop_over_result` → `for_loops_over_fallibles` Lints that have already been merged since the issue was created: - [x] `new_without_default` and `new_without_default_derive` → `new_without_default` Need more discussion: - `string_add` and `string_add_assign`: do we agree to merge them or not? Is there something more to do? → **not merge finally** - `identity_op` and `modulo_one` → `useless_arithmetic`: seems outdated, since `modulo_arithmetic` has been created. fixes #1078 changelog: Merging some lints together: - `block_in_if_condition_expr` and `block_in_if_condition_stmt` → `blocks_in_if_conditions` - `option_map_unwrap_or`, `option_map_unwrap_or_else` and `result_map_unwrap_or_else` → `map_unwrap_or` - `option_unwrap_used` and `result_unwrap_used` → `unwrap_used` - `option_expect_used` and `result_expect_used` → `expect_used` - `for_loop_over_option` and `for_loop_over_result` → `for_loops_over_fallibles`
This commit is contained in:
@@ -180,7 +180,7 @@ mod attrs;
|
||||
mod await_holding_lock;
|
||||
mod bit_mask;
|
||||
mod blacklisted_name;
|
||||
mod block_in_if_condition;
|
||||
mod blocks_in_if_conditions;
|
||||
mod booleans;
|
||||
mod bytecount;
|
||||
mod cargo_common_metadata;
|
||||
@@ -507,8 +507,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
&bit_mask::INEFFECTIVE_BIT_MASK,
|
||||
&bit_mask::VERBOSE_BIT_MASK,
|
||||
&blacklisted_name::BLACKLISTED_NAME,
|
||||
&block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR,
|
||||
&block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT,
|
||||
&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS,
|
||||
&booleans::LOGIC_BUG,
|
||||
&booleans::NONMINIMAL_BOOL,
|
||||
&bytecount::NAIVE_BYTECOUNT,
|
||||
@@ -616,8 +615,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
&loops::EXPLICIT_INTO_ITER_LOOP,
|
||||
&loops::EXPLICIT_ITER_LOOP,
|
||||
&loops::FOR_KV_MAP,
|
||||
&loops::FOR_LOOP_OVER_OPTION,
|
||||
&loops::FOR_LOOP_OVER_RESULT,
|
||||
&loops::FOR_LOOPS_OVER_FALLIBLES,
|
||||
&loops::ITER_NEXT_LOOP,
|
||||
&loops::MANUAL_MEMCPY,
|
||||
&loops::MUT_RANGE_BOUND,
|
||||
@@ -658,6 +656,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
&methods::CLONE_ON_COPY,
|
||||
&methods::CLONE_ON_REF_PTR,
|
||||
&methods::EXPECT_FUN_CALL,
|
||||
&methods::EXPECT_USED,
|
||||
&methods::FILETYPE_IS_FILE,
|
||||
&methods::FILTER_MAP,
|
||||
&methods::FILTER_MAP_NEXT,
|
||||
@@ -674,20 +673,14 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
&methods::ITER_SKIP_NEXT,
|
||||
&methods::MANUAL_SATURATING_ARITHMETIC,
|
||||
&methods::MAP_FLATTEN,
|
||||
&methods::MAP_UNWRAP_OR,
|
||||
&methods::NEW_RET_NO_SELF,
|
||||
&methods::OK_EXPECT,
|
||||
&methods::OPTION_AND_THEN_SOME,
|
||||
&methods::OPTION_AS_REF_DEREF,
|
||||
&methods::OPTION_EXPECT_USED,
|
||||
&methods::OPTION_MAP_OR_NONE,
|
||||
&methods::OPTION_MAP_UNWRAP_OR,
|
||||
&methods::OPTION_MAP_UNWRAP_OR_ELSE,
|
||||
&methods::OPTION_UNWRAP_USED,
|
||||
&methods::OR_FUN_CALL,
|
||||
&methods::RESULT_EXPECT_USED,
|
||||
&methods::RESULT_MAP_OR_INTO_OPTION,
|
||||
&methods::RESULT_MAP_UNWRAP_OR_ELSE,
|
||||
&methods::RESULT_UNWRAP_USED,
|
||||
&methods::SEARCH_IS_SOME,
|
||||
&methods::SHOULD_IMPLEMENT_TRAIT,
|
||||
&methods::SINGLE_CHAR_PATTERN,
|
||||
@@ -698,6 +691,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
&methods::UNINIT_ASSUMED_INIT,
|
||||
&methods::UNNECESSARY_FILTER_MAP,
|
||||
&methods::UNNECESSARY_FOLD,
|
||||
&methods::UNWRAP_USED,
|
||||
&methods::USELESS_ASREF,
|
||||
&methods::WRONG_PUB_SELF_CONVENTION,
|
||||
&methods::WRONG_SELF_CONVENTION,
|
||||
@@ -900,7 +894,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
store.register_late_pass(|| box mut_reference::UnnecessaryMutPassed);
|
||||
store.register_late_pass(|| box len_zero::LenZero);
|
||||
store.register_late_pass(|| box attrs::Attributes);
|
||||
store.register_late_pass(|| box block_in_if_condition::BlockInIfCondition);
|
||||
store.register_late_pass(|| box blocks_in_if_conditions::BlocksInIfConditions);
|
||||
store.register_late_pass(|| box unicode::Unicode);
|
||||
store.register_late_pass(|| box strings::StringAdd);
|
||||
store.register_late_pass(|| box implicit_return::ImplicitReturn);
|
||||
@@ -1090,12 +1084,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
LintId::of(&matches::WILDCARD_ENUM_MATCH_ARM),
|
||||
LintId::of(&mem_forget::MEM_FORGET),
|
||||
LintId::of(&methods::CLONE_ON_REF_PTR),
|
||||
LintId::of(&methods::EXPECT_USED),
|
||||
LintId::of(&methods::FILETYPE_IS_FILE),
|
||||
LintId::of(&methods::GET_UNWRAP),
|
||||
LintId::of(&methods::OPTION_EXPECT_USED),
|
||||
LintId::of(&methods::OPTION_UNWRAP_USED),
|
||||
LintId::of(&methods::RESULT_EXPECT_USED),
|
||||
LintId::of(&methods::RESULT_UNWRAP_USED),
|
||||
LintId::of(&methods::UNWRAP_USED),
|
||||
LintId::of(&methods::WRONG_PUB_SELF_CONVENTION),
|
||||
LintId::of(&misc::FLOAT_CMP_CONST),
|
||||
LintId::of(&misc_early::UNNEEDED_FIELD_PATTERN),
|
||||
@@ -1153,9 +1145,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::OPTION_MAP_UNWRAP_OR),
|
||||
LintId::of(&methods::OPTION_MAP_UNWRAP_OR_ELSE),
|
||||
LintId::of(&methods::RESULT_MAP_UNWRAP_OR_ELSE),
|
||||
LintId::of(&methods::MAP_UNWRAP_OR),
|
||||
LintId::of(&misc::USED_UNDERSCORE_BINDING),
|
||||
LintId::of(&misc_early::UNSEPARATED_LITERAL_SUFFIX),
|
||||
LintId::of(&mut_mut::MUT_MUT),
|
||||
@@ -1209,8 +1199,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
LintId::of(&bit_mask::INEFFECTIVE_BIT_MASK),
|
||||
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
|
||||
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
|
||||
LintId::of(&block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR),
|
||||
LintId::of(&block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT),
|
||||
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
|
||||
LintId::of(&booleans::LOGIC_BUG),
|
||||
LintId::of(&booleans::NONMINIMAL_BOOL),
|
||||
LintId::of(&bytecount::NAIVE_BYTECOUNT),
|
||||
@@ -1274,8 +1263,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
LintId::of(&loops::EMPTY_LOOP),
|
||||
LintId::of(&loops::EXPLICIT_COUNTER_LOOP),
|
||||
LintId::of(&loops::FOR_KV_MAP),
|
||||
LintId::of(&loops::FOR_LOOP_OVER_OPTION),
|
||||
LintId::of(&loops::FOR_LOOP_OVER_RESULT),
|
||||
LintId::of(&loops::FOR_LOOPS_OVER_FALLIBLES),
|
||||
LintId::of(&loops::ITER_NEXT_LOOP),
|
||||
LintId::of(&loops::MANUAL_MEMCPY),
|
||||
LintId::of(&loops::MUT_RANGE_BOUND),
|
||||
@@ -1455,8 +1443,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
LintId::of(&attrs::UNKNOWN_CLIPPY_LINTS),
|
||||
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
|
||||
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
|
||||
LintId::of(&block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR),
|
||||
LintId::of(&block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT),
|
||||
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
|
||||
LintId::of(&collapsible_if::COLLAPSIBLE_IF),
|
||||
LintId::of(&comparison_chain::COMPARISON_CHAIN),
|
||||
LintId::of(&doc::MISSING_SAFETY_DOC),
|
||||
@@ -1650,8 +1637,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
|
||||
LintId::of(&inline_fn_without_body::INLINE_FN_WITHOUT_BODY),
|
||||
LintId::of(&let_underscore::LET_UNDERSCORE_LOCK),
|
||||
LintId::of(&literal_representation::MISTYPED_LITERAL_SUFFIXES),
|
||||
LintId::of(&loops::FOR_LOOP_OVER_OPTION),
|
||||
LintId::of(&loops::FOR_LOOP_OVER_RESULT),
|
||||
LintId::of(&loops::FOR_LOOPS_OVER_FALLIBLES),
|
||||
LintId::of(&loops::ITER_NEXT_LOOP),
|
||||
LintId::of(&loops::NEVER_LOOP),
|
||||
LintId::of(&loops::WHILE_IMMUTABLE_CONDITION),
|
||||
@@ -1798,6 +1784,17 @@ pub fn register_renamed(ls: &mut rustc_lint::LintStore) {
|
||||
ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
|
||||
ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");
|
||||
ls.register_renamed("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes");
|
||||
ls.register_renamed("clippy::block_in_if_condition_expr", "clippy::blocks_in_if_conditions");
|
||||
ls.register_renamed("clippy::block_in_if_condition_stmt", "clippy::blocks_in_if_conditions");
|
||||
ls.register_renamed("clippy::option_map_unwrap_or", "clippy::map_unwrap_or");
|
||||
ls.register_renamed("clippy::option_map_unwrap_or_else", "clippy::map_unwrap_or");
|
||||
ls.register_renamed("clippy::result_map_unwrap_or_else", "clippy::map_unwrap_or");
|
||||
ls.register_renamed("clippy::option_unwrap_used", "clippy::unwrap_used");
|
||||
ls.register_renamed("clippy::result_unwrap_used", "clippy::unwrap_used");
|
||||
ls.register_renamed("clippy::option_expect_used", "clippy::expect_used");
|
||||
ls.register_renamed("clippy::result_expect_used", "clippy::expect_used");
|
||||
ls.register_renamed("clippy::for_loop_over_option", "clippy::for_loops_over_fallibles");
|
||||
ls.register_renamed("clippy::for_loop_over_result", "clippy::for_loops_over_fallibles");
|
||||
}
|
||||
|
||||
// only exists to let the dogfood integration test works.
|
||||
|
||||
Reference in New Issue
Block a user