Skip to content

Commit 9ea9c09

Browse files
committed
Introduce opaque type to hidden type projection
1 parent b2ae24e commit 9ea9c09

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ pub(crate) fn codegen_place<'tcx>(
825825
cplace = cplace.place_deref(fx);
826826
}
827827
}
828+
PlaceElem::OpaqueCast(ty) => cplace = cplace.place_opaque_cast(fx, ty),
828829
PlaceElem::Field(field, _ty) => {
829830
cplace = cplace.place_field(fx, field);
830831
}

src/value_and_place.rs

+8
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,14 @@ impl<'tcx> CPlace<'tcx> {
615615
}
616616
}
617617

618+
pub(crate) fn place_opaque_cast(
619+
self,
620+
fx: &mut FunctionCx<'_, '_, 'tcx>,
621+
ty: Ty<'tcx>,
622+
) -> CPlace<'tcx> {
623+
CPlace { inner: self.inner, layout: fx.layout_of(ty) }
624+
}
625+
618626
pub(crate) fn place_field(
619627
self,
620628
fx: &mut FunctionCx<'_, '_, 'tcx>,

0 commit comments

Comments
 (0)