Normalize transparent struct field type in CFI

This commit is contained in:
Michael Goulet 2024-09-20 17:52:43 -04:00
parent 914193c8f4
commit d3f270b542

View File

@ -146,7 +146,10 @@ fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
!is_zst
});
if let Some(field) = field {
let ty0 = self.tcx.erase_regions(field.ty(self.tcx, args));
let ty0 = self.tcx.normalize_erasing_regions(
ty::ParamEnv::reveal_all(),
field.ty(self.tcx, args),
);
// Generalize any repr(transparent) user-defined type that is either a
// pointer or reference, and either references itself or any other type that
// contains or references itself, to avoid a reference cycle.