Introduce opaque type to hidden type projection

This commit is contained in:
Oli Scherer 2022-06-22 15:28:28 +00:00
parent b2ae24e6a1
commit 9ea9c093e5
2 changed files with 9 additions and 0 deletions

View File

@ -825,6 +825,7 @@ pub(crate) fn codegen_place<'tcx>(
cplace = cplace.place_deref(fx);
}
}
PlaceElem::OpaqueCast(ty) => cplace = cplace.place_opaque_cast(fx, ty),
PlaceElem::Field(field, _ty) => {
cplace = cplace.place_field(fx, field);
}

View File

@ -615,6 +615,14 @@ fn transmute_value<'tcx>(
}
}
pub(crate) fn place_opaque_cast(
self,
fx: &mut FunctionCx<'_, '_, 'tcx>,
ty: Ty<'tcx>,
) -> CPlace<'tcx> {
CPlace { inner: self.inner, layout: fx.layout_of(ty) }
}
pub(crate) fn place_field(
self,
fx: &mut FunctionCx<'_, '_, 'tcx>,