Skip to content

Commit b1a3e7e

Browse files
committed
Auto merge of #8937 - Jarcho:merge_match_passes, r=llogiq
Merge various passes into `Matches` changelog: None
2 parents ebd357e + 68c411f commit b1a3e7e

24 files changed

+1052
-1034
lines changed

clippy_lints/src/lib.register_all.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
3838
LintId::of(casts::UNNECESSARY_CAST),
3939
LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF),
4040
LintId::of(collapsible_if::COLLAPSIBLE_IF),
41-
LintId::of(collapsible_match::COLLAPSIBLE_MATCH),
4241
LintId::of(comparison_chain::COMPARISON_CHAIN),
4342
LintId::of(copies::IFS_SAME_COND),
4443
LintId::of(copies::IF_SAME_THEN_ELSE),
@@ -134,23 +133,25 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
134133
LintId::of(main_recursion::MAIN_RECURSION),
135134
LintId::of(manual_async_fn::MANUAL_ASYNC_FN),
136135
LintId::of(manual_bits::MANUAL_BITS),
137-
LintId::of(manual_map::MANUAL_MAP),
138136
LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
139137
LintId::of(manual_strip::MANUAL_STRIP),
140-
LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR),
141138
LintId::of(map_clone::MAP_CLONE),
142139
LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN),
143140
LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN),
144141
LintId::of(match_result_ok::MATCH_RESULT_OK),
145-
LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH),
142+
LintId::of(matches::COLLAPSIBLE_MATCH),
146143
LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH),
144+
LintId::of(matches::MANUAL_MAP),
145+
LintId::of(matches::MANUAL_UNWRAP_OR),
147146
LintId::of(matches::MATCH_AS_REF),
148147
LintId::of(matches::MATCH_LIKE_MATCHES_MACRO),
149148
LintId::of(matches::MATCH_OVERLAPPING_ARM),
150149
LintId::of(matches::MATCH_REF_PATS),
151150
LintId::of(matches::MATCH_SINGLE_BINDING),
151+
LintId::of(matches::MATCH_STR_CASE_MISMATCH),
152152
LintId::of(matches::NEEDLESS_MATCH),
153153
LintId::of(matches::REDUNDANT_PATTERN_MATCHING),
154+
LintId::of(matches::SIGNIFICANT_DROP_IN_SCRUTINEE),
154155
LintId::of(matches::SINGLE_MATCH),
155156
LintId::of(matches::WILDCARD_IN_OR_PATTERNS),
156157
LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
@@ -282,7 +283,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
282283
LintId::of(self_assignment::SELF_ASSIGNMENT),
283284
LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS),
284285
LintId::of(serde_api::SERDE_API_MISUSE),
285-
LintId::of(significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE),
286286
LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
287287
LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT),
288288
LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),

clippy_lints/src/lib.register_complexity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec!
2525
LintId::of(loops::SINGLE_ELEMENT_LOOP),
2626
LintId::of(loops::WHILE_LET_LOOP),
2727
LintId::of(manual_strip::MANUAL_STRIP),
28-
LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR),
2928
LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN),
3029
LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN),
30+
LintId::of(matches::MANUAL_UNWRAP_OR),
3131
LintId::of(matches::MATCH_AS_REF),
3232
LintId::of(matches::MATCH_SINGLE_BINDING),
3333
LintId::of(matches::NEEDLESS_MATCH),

clippy_lints/src/lib.register_correctness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ store.register_group(true, "clippy::correctness", Some("clippy_correctness"), ve
3939
LintId::of(loops::ITER_NEXT_LOOP),
4040
LintId::of(loops::NEVER_LOOP),
4141
LintId::of(loops::WHILE_IMMUTABLE_CONDITION),
42-
LintId::of(match_str_case_mismatch::MATCH_STR_CASE_MISMATCH),
42+
LintId::of(matches::MATCH_STR_CASE_MISMATCH),
4343
LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT),
4444
LintId::of(methods::CLONE_DOUBLE_REF),
4545
LintId::of(methods::ITERATOR_STEP_BY_ZERO),

clippy_lints/src/lib.register_lints.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ store.register_lints(&[
9494
cognitive_complexity::COGNITIVE_COMPLEXITY,
9595
collapsible_if::COLLAPSIBLE_ELSE_IF,
9696
collapsible_if::COLLAPSIBLE_IF,
97-
collapsible_match::COLLAPSIBLE_MATCH,
9897
comparison_chain::COMPARISON_CHAIN,
9998
copies::BRANCHES_SHARING_CODE,
10099
copies::IFS_SAME_COND,
@@ -252,33 +251,36 @@ store.register_lints(&[
252251
manual_assert::MANUAL_ASSERT,
253252
manual_async_fn::MANUAL_ASYNC_FN,
254253
manual_bits::MANUAL_BITS,
255-
manual_map::MANUAL_MAP,
256254
manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE,
257255
manual_ok_or::MANUAL_OK_OR,
258256
manual_strip::MANUAL_STRIP,
259-
manual_unwrap_or::MANUAL_UNWRAP_OR,
260257
map_clone::MAP_CLONE,
261258
map_err_ignore::MAP_ERR_IGNORE,
262259
map_unit_fn::OPTION_MAP_UNIT_FN,
263260
map_unit_fn::RESULT_MAP_UNIT_FN,
264-
match_on_vec_items::MATCH_ON_VEC_ITEMS,
265261
match_result_ok::MATCH_RESULT_OK,
266-
match_str_case_mismatch::MATCH_STR_CASE_MISMATCH,
262+
matches::COLLAPSIBLE_MATCH,
267263
matches::INFALLIBLE_DESTRUCTURING_MATCH,
264+
matches::MANUAL_MAP,
265+
matches::MANUAL_UNWRAP_OR,
268266
matches::MATCH_AS_REF,
269267
matches::MATCH_BOOL,
270268
matches::MATCH_LIKE_MATCHES_MACRO,
269+
matches::MATCH_ON_VEC_ITEMS,
271270
matches::MATCH_OVERLAPPING_ARM,
272271
matches::MATCH_REF_PATS,
273272
matches::MATCH_SAME_ARMS,
274273
matches::MATCH_SINGLE_BINDING,
274+
matches::MATCH_STR_CASE_MISMATCH,
275275
matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS,
276276
matches::MATCH_WILD_ERR_ARM,
277277
matches::NEEDLESS_MATCH,
278278
matches::REDUNDANT_PATTERN_MATCHING,
279279
matches::REST_PAT_IN_FULLY_BOUND_STRUCTS,
280+
matches::SIGNIFICANT_DROP_IN_SCRUTINEE,
280281
matches::SINGLE_MATCH,
281282
matches::SINGLE_MATCH_ELSE,
283+
matches::TRY_ERR,
282284
matches::WILDCARD_ENUM_MATCH_ARM,
283285
matches::WILDCARD_IN_OR_PATTERNS,
284286
mem_forget::MEM_FORGET,
@@ -480,7 +482,6 @@ store.register_lints(&[
480482
shadow::SHADOW_REUSE,
481483
shadow::SHADOW_SAME,
482484
shadow::SHADOW_UNRELATED,
483-
significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE,
484485
single_char_lifetime_names::SINGLE_CHAR_LIFETIME_NAMES,
485486
single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS,
486487
size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT,
@@ -522,7 +523,6 @@ store.register_lints(&[
522523
transmute::USELESS_TRANSMUTE,
523524
transmute::WRONG_TRANSMUTE,
524525
transmuting_null::TRANSMUTING_NULL,
525-
try_err::TRY_ERR,
526526
types::BORROWED_BOX,
527527
types::BOX_COLLECTION,
528528
types::LINKEDLIST,

clippy_lints/src/lib.register_pedantic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
5151
LintId::of(macro_use::MACRO_USE_IMPORTS),
5252
LintId::of(manual_assert::MANUAL_ASSERT),
5353
LintId::of(manual_ok_or::MANUAL_OK_OR),
54-
LintId::of(match_on_vec_items::MATCH_ON_VEC_ITEMS),
5554
LintId::of(matches::MATCH_BOOL),
55+
LintId::of(matches::MATCH_ON_VEC_ITEMS),
5656
LintId::of(matches::MATCH_SAME_ARMS),
5757
LintId::of(matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS),
5858
LintId::of(matches::MATCH_WILD_ERR_ARM),

clippy_lints/src/lib.register_restriction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), ve
3131
LintId::of(literal_representation::DECIMAL_LITERAL_REPRESENTATION),
3232
LintId::of(map_err_ignore::MAP_ERR_IGNORE),
3333
LintId::of(matches::REST_PAT_IN_FULLY_BOUND_STRUCTS),
34+
LintId::of(matches::TRY_ERR),
3435
LintId::of(matches::WILDCARD_ENUM_MATCH_ARM),
3536
LintId::of(mem_forget::MEM_FORGET),
3637
LintId::of(methods::CLONE_ON_REF_PTR),
@@ -68,7 +69,6 @@ store.register_group(true, "clippy::restriction", Some("clippy_restriction"), ve
6869
LintId::of(strings::STRING_SLICE),
6970
LintId::of(strings::STRING_TO_STRING),
7071
LintId::of(strings::STR_TO_STRING),
71-
LintId::of(try_err::TRY_ERR),
7272
LintId::of(types::RC_BUFFER),
7373
LintId::of(types::RC_MUTEX),
7474
LintId::of(undocumented_unsafe_blocks::UNDOCUMENTED_UNSAFE_BLOCKS),

clippy_lints/src/lib.register_style.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
1212
LintId::of(casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
1313
LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF),
1414
LintId::of(collapsible_if::COLLAPSIBLE_IF),
15-
LintId::of(collapsible_match::COLLAPSIBLE_MATCH),
1615
LintId::of(comparison_chain::COMPARISON_CHAIN),
1716
LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT),
1817
LintId::of(dereference::NEEDLESS_BORROW),
@@ -46,11 +45,12 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
4645
LintId::of(main_recursion::MAIN_RECURSION),
4746
LintId::of(manual_async_fn::MANUAL_ASYNC_FN),
4847
LintId::of(manual_bits::MANUAL_BITS),
49-
LintId::of(manual_map::MANUAL_MAP),
5048
LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
5149
LintId::of(map_clone::MAP_CLONE),
5250
LintId::of(match_result_ok::MATCH_RESULT_OK),
51+
LintId::of(matches::COLLAPSIBLE_MATCH),
5352
LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH),
53+
LintId::of(matches::MANUAL_MAP),
5454
LintId::of(matches::MATCH_LIKE_MATCHES_MACRO),
5555
LintId::of(matches::MATCH_OVERLAPPING_ARM),
5656
LintId::of(matches::MATCH_REF_PATS),

clippy_lints/src/lib.register_suspicious.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec!
2424
LintId::of(loops::EMPTY_LOOP),
2525
LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES),
2626
LintId::of(loops::MUT_RANGE_BOUND),
27+
LintId::of(matches::SIGNIFICANT_DROP_IN_SCRUTINEE),
2728
LintId::of(methods::NO_EFFECT_REPLACE),
2829
LintId::of(methods::SUSPICIOUS_MAP),
2930
LintId::of(mut_key::MUTABLE_KEY_TYPE),
3031
LintId::of(octal_escapes::OCTAL_ESCAPES),
3132
LintId::of(rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT),
32-
LintId::of(significant_drop_in_scrutinee::SIGNIFICANT_DROP_IN_SCRUTINEE),
3333
LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
3434
LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
3535
LintId::of(swap_ptr_to_ref::SWAP_PTR_TO_REF),

clippy_lints/src/lib.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ mod casts;
193193
mod checked_conversions;
194194
mod cognitive_complexity;
195195
mod collapsible_if;
196-
mod collapsible_match;
197196
mod comparison_chain;
198197
mod copies;
199198
mod copy_iterator;
@@ -281,17 +280,13 @@ mod main_recursion;
281280
mod manual_assert;
282281
mod manual_async_fn;
283282
mod manual_bits;
284-
mod manual_map;
285283
mod manual_non_exhaustive;
286284
mod manual_ok_or;
287285
mod manual_strip;
288-
mod manual_unwrap_or;
289286
mod map_clone;
290287
mod map_err_ignore;
291288
mod map_unit_fn;
292-
mod match_on_vec_items;
293289
mod match_result_ok;
294-
mod match_str_case_mismatch;
295290
mod matches;
296291
mod mem_forget;
297292
mod mem_replace;
@@ -372,7 +367,6 @@ mod self_named_constructors;
372367
mod semicolon_if_nothing_returned;
373368
mod serde_api;
374369
mod shadow;
375-
mod significant_drop_in_scrutinee;
376370
mod single_char_lifetime_names;
377371
mod single_component_path_imports;
378372
mod size_of_in_element_count;
@@ -391,7 +385,6 @@ mod trailing_empty_array;
391385
mod trait_bounds;
392386
mod transmute;
393387
mod transmuting_null;
394-
mod try_err;
395388
mod types;
396389
mod undocumented_unsafe_blocks;
397390
mod unicode;
@@ -569,7 +562,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
569562
store.register_late_pass(|| Box::new(len_zero::LenZero));
570563
store.register_late_pass(|| Box::new(attrs::Attributes));
571564
store.register_late_pass(|| Box::new(blocks_in_if_conditions::BlocksInIfConditions));
572-
store.register_late_pass(|| Box::new(collapsible_match::CollapsibleMatch));
573565
store.register_late_pass(|| Box::new(unicode::Unicode));
574566
store.register_late_pass(|| Box::new(uninit_vec::UninitVec));
575567
store.register_late_pass(|| Box::new(unit_hash::UnitHash));
@@ -707,7 +699,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
707699
);
708700
store.register_late_pass(move || Box::new(pass_by_ref_or_value));
709701
store.register_late_pass(|| Box::new(ref_option_ref::RefOptionRef));
710-
store.register_late_pass(|| Box::new(try_err::TryErr));
711702
store.register_late_pass(|| Box::new(bytecount::ByteCount));
712703
store.register_late_pass(|| Box::new(infinite_iter::InfiniteIter));
713704
store.register_late_pass(|| Box::new(inline_fn_without_body::InlineFnWithoutBody));
@@ -819,7 +810,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
819810
store.register_late_pass(|| Box::new(if_not_else::IfNotElse));
820811
store.register_late_pass(|| Box::new(equatable_if_let::PatternEquality));
821812
store.register_late_pass(|| Box::new(mut_mutex_lock::MutMutexLock));
822-
store.register_late_pass(|| Box::new(match_on_vec_items::MatchOnVecItems));
823813
store.register_late_pass(|| Box::new(manual_async_fn::ManualAsyncFn));
824814
store.register_late_pass(|| Box::new(vec_resize_to_zero::VecResizeToZero));
825815
store.register_late_pass(|| Box::new(panic_in_result_fn::PanicInResultFn));
@@ -837,7 +827,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
837827
store.register_late_pass(|| Box::new(repeat_once::RepeatOnce));
838828
store.register_late_pass(|| Box::new(unwrap_in_result::UnwrapInResult));
839829
store.register_late_pass(|| Box::new(self_assignment::SelfAssignment));
840-
store.register_late_pass(|| Box::new(manual_unwrap_or::ManualUnwrapOr));
841830
store.register_late_pass(|| Box::new(manual_ok_or::ManualOkOr));
842831
store.register_late_pass(|| Box::new(float_equality_without_abs::FloatEqualityWithoutAbs));
843832
store.register_late_pass(|| Box::new(semicolon_if_nothing_returned::SemicolonIfNothingReturned));
@@ -856,7 +845,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
856845
});
857846
store.register_late_pass(|| Box::new(redundant_slicing::RedundantSlicing));
858847
store.register_late_pass(|| Box::new(from_str_radix_10::FromStrRadix10));
859-
store.register_late_pass(|| Box::new(manual_map::ManualMap));
860848
store.register_late_pass(move || Box::new(if_then_some_else_none::IfThenSomeElseNone::new(msrv)));
861849
store.register_late_pass(|| Box::new(bool_assert_comparison::BoolAssertComparison));
862850
store.register_early_pass(move || Box::new(module_style::ModStyle));
@@ -882,7 +870,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
882870
))
883871
});
884872
store.register_late_pass(move || Box::new(undocumented_unsafe_blocks::UndocumentedUnsafeBlocks));
885-
store.register_late_pass(|| Box::new(match_str_case_mismatch::MatchStrCaseMismatch));
886873
store.register_late_pass(move || Box::new(format_args::FormatArgs));
887874
store.register_late_pass(|| Box::new(trailing_empty_array::TrailingEmptyArray));
888875
store.register_early_pass(|| Box::new(octal_escapes::OctalEscapes));
@@ -895,7 +882,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
895882
store.register_late_pass(|| Box::new(default_union_representation::DefaultUnionRepresentation));
896883
store.register_early_pass(|| Box::new(doc_link_with_quotes::DocLinkWithQuotes));
897884
store.register_late_pass(|| Box::new(only_used_in_recursion::OnlyUsedInRecursion));
898-
store.register_late_pass(|| Box::new(significant_drop_in_scrutinee::SignificantDropInScrutinee));
899885
let allow_dbg_in_tests = conf.allow_dbg_in_tests;
900886
store.register_late_pass(move || Box::new(dbg_macro::DbgMacro::new(allow_dbg_in_tests)));
901887
let cargo_ignore_publish = conf.cargo_ignore_publish;

0 commit comments

Comments
 (0)