Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit af959b2

Browse files
committed
Auto merge of #289 - dario23:apply-nested-or-patterns, r=JohnTitor
Apply or-patterns clippy suggestion The corresponding feature has been stabilized in rust-lang/rust#79278, merged 2021-03-22.
2 parents 324a149 + 6f7eb40 commit af959b2

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
#![allow(clippy::similar_names)]
44
#![allow(clippy::single_match_else)]
55
#![allow(clippy::too_many_lines)]
6-
// Needs a nightly feature, doesn't bring that much to the table
7-
// FIXME: Apply Clippy lint once or-patterns are stabilized (rust-lang/rust#54883)
8-
#![allow(clippy::unnested_or_patterns)]
96
#![deny(warnings)]
107

118
extern crate rustc_const_eval; // Requires `rustup component add rustc-dev`

src/traverse.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ fn diff_types<'tcx>(
888888

889889
match old {
890890
// type aliases, consts and statics just need their type to be checked
891-
Def(TyAlias, _) | Def(Const, _) | Def(Static, _) => {
891+
Def(TyAlias | Const | Static, _) => {
892892
cmp_types(
893893
changes,
894894
id_mapping,
@@ -900,7 +900,7 @@ fn diff_types<'tcx>(
900900
);
901901
}
902902
// functions and methods require us to compare their signatures, not types
903-
Def(Fn, _) | Def(AssocFn, _) => {
903+
Def(Fn | AssocFn, _) => {
904904
let old_fn_sig = tcx.type_of(old_def_id).fn_sig(tcx);
905905
let new_fn_sig = tcx.type_of(new_def_id).fn_sig(tcx);
906906

@@ -915,7 +915,7 @@ fn diff_types<'tcx>(
915915
);
916916
}
917917
// ADTs' types are compared field-wise
918-
Def(Struct, _) | Def(Enum, _) | Def(Union, _) => {
918+
Def(Struct | Enum | Union, _) => {
919919
if let Some(children) = id_mapping.children_of(old_def_id) {
920920
for (o_def_id, n_def_id) in children {
921921
let o_ty = tcx.type_of(o_def_id);

0 commit comments

Comments
 (0)