From 6f7eb400c77cf8f0666eabaead8b7af468a4a98d Mon Sep 17 00:00:00 2001 From: Johannes Schilling Date: Fri, 6 May 2022 22:17:25 +0200 Subject: [PATCH] Apply or-patterns clippy suggestion The corresponding feature has been stabilized in rust-lang/rust#79278, merged 2021-03-22. --- src/lib.rs | 3 --- src/traverse.rs | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5ead1ba5..55f44f1e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,9 +3,6 @@ #![allow(clippy::similar_names)] #![allow(clippy::single_match_else)] #![allow(clippy::too_many_lines)] -// Needs a nightly feature, doesn't bring that much to the table -// FIXME: Apply Clippy lint once or-patterns are stabilized (rust-lang/rust#54883) -#![allow(clippy::unnested_or_patterns)] #![deny(warnings)] extern crate rustc_const_eval; // Requires `rustup component add rustc-dev` diff --git a/src/traverse.rs b/src/traverse.rs index d69bafcb..3875a23e 100644 --- a/src/traverse.rs +++ b/src/traverse.rs @@ -875,7 +875,7 @@ fn diff_types<'tcx>( match old { // type aliases, consts and statics just need their type to be checked - Def(TyAlias, _) | Def(Const, _) | Def(Static, _) => { + Def(TyAlias | Const | Static, _) => { cmp_types( changes, id_mapping, @@ -887,7 +887,7 @@ fn diff_types<'tcx>( ); } // functions and methods require us to compare their signatures, not types - Def(Fn, _) | Def(AssocFn, _) => { + Def(Fn | AssocFn, _) => { let old_fn_sig = tcx.type_of(old_def_id).fn_sig(tcx); let new_fn_sig = tcx.type_of(new_def_id).fn_sig(tcx); @@ -902,7 +902,7 @@ fn diff_types<'tcx>( ); } // ADTs' types are compared field-wise - Def(Struct, _) | Def(Enum, _) | Def(Union, _) => { + Def(Struct | Enum | Union, _) => { if let Some(children) = id_mapping.children_of(old_def_id) { for (o_def_id, n_def_id) in children { let o_ty = tcx.type_of(o_def_id);