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

Commit

Permalink
Auto merge of #289 - dario23:apply-nested-or-patterns, r=JohnTitor
Browse files Browse the repository at this point in the history
Apply or-patterns clippy suggestion

The corresponding feature has been stabilized in rust-lang/rust#79278,
merged 2021-03-22.
  • Loading branch information
bors committed May 7, 2022
2 parents 324a149 + 6f7eb40 commit af959b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
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 @@ -888,7 +888,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 @@ -900,7 +900,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 @@ -915,7 +915,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

0 comments on commit af959b2

Please sign in to comment.