Skip to content

Commit 05101ff

Browse files
committed
Lower anonymous structs or unions to HIR
1 parent 036d00b commit 05101ff

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ impl TyCoercionStability {
831831
| TyKind::Typeof(..)
832832
| TyKind::TraitObject(..)
833833
| TyKind::InferDelegation(..)
834+
| TyKind::AnonAdt(..)
834835
| TyKind::Err(_) => Self::Reborrow,
835836
};
836837
}

clippy_utils/src/hir_utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ impl HirEqInterExpr<'_, '_, '_> {
515515
(TyKind::Path(l), TyKind::Path(r)) => self.eq_qpath(l, r),
516516
(&TyKind::Tup(l), &TyKind::Tup(r)) => over(l, r, |l, r| self.eq_ty(l, r)),
517517
(&TyKind::Infer, &TyKind::Infer) => true,
518+
(TyKind::AnonAdt(l_item_id), TyKind::AnonAdt(r_item_id)) => l_item_id == r_item_id,
518519
_ => false,
519520
}
520521
}
@@ -1108,7 +1109,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
11081109
TyKind::Typeof(anon_const) => {
11091110
self.hash_body(anon_const.body);
11101111
},
1111-
TyKind::Err(_) | TyKind::Infer | TyKind::Never | TyKind::InferDelegation(..) => {},
1112+
TyKind::Err(_) | TyKind::Infer | TyKind::Never | TyKind::InferDelegation(..) | TyKind::AnonAdt(_) => {},
11121113
}
11131114
}
11141115

0 commit comments

Comments
 (0)