Lower anonymous structs or unions to HIR

This commit is contained in:
Frank King
2024-01-04 21:53:06 +08:00
parent 036d00bff6
commit 05101ffe5b
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -831,6 +831,7 @@ fn for_hir_ty<'tcx>(ty: &'tcx hir::Ty<'tcx>) -> Self {
| TyKind::Typeof(..)
| TyKind::TraitObject(..)
| TyKind::InferDelegation(..)
| TyKind::AnonAdt(..)
| TyKind::Err(_) => Self::Reborrow,
};
}
+2 -1
View File
@@ -515,6 +515,7 @@ pub fn eq_ty(&mut self, left: &Ty<'_>, right: &Ty<'_>) -> bool {
(TyKind::Path(l), TyKind::Path(r)) => self.eq_qpath(l, r),
(&TyKind::Tup(l), &TyKind::Tup(r)) => over(l, r, |l, r| self.eq_ty(l, r)),
(&TyKind::Infer, &TyKind::Infer) => true,
(TyKind::AnonAdt(l_item_id), TyKind::AnonAdt(r_item_id)) => l_item_id == r_item_id,
_ => false,
}
}
@@ -1108,7 +1109,7 @@ pub fn hash_tykind(&mut self, ty: &TyKind<'_>) {
TyKind::Typeof(anon_const) => {
self.hash_body(anon_const.body);
},
TyKind::Err(_) | TyKind::Infer | TyKind::Never | TyKind::InferDelegation(..) => {},
TyKind::Err(_) | TyKind::Infer | TyKind::Never | TyKind::InferDelegation(..) | TyKind::AnonAdt(_) => {},
}
}