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

Apply or-patterns clippy suggestion #289

Merged
merged 1 commit into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
6 changes: 3 additions & 3 deletions src/traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);

Expand All @@ -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);
Expand Down