Skip to content

Commit 93af5f5

Browse files
committed
Revert "Revert "Rollup merge of rust-lang#98582 - oli-obk:unconstrained_opaque_type, r=estebank""
This reverts commit 4a742a6.
1 parent e4d2f94 commit 93af5f5

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
@@ -850,6 +850,7 @@ pub(crate) fn codegen_place<'tcx>(
850850
PlaceElem::Deref => {
851851
cplace = cplace.place_deref(fx);
852852
}
853+
PlaceElem::OpaqueCast(ty) => cplace = cplace.place_opaque_cast(fx, ty),
853854
PlaceElem::Field(field, _ty) => {
854855
cplace = cplace.place_field(fx, field);
855856
}

src/value_and_place.rs

+8
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,14 @@ impl<'tcx> CPlace<'tcx> {
621621
}
622622
}
623623

624+
pub(crate) fn place_opaque_cast(
625+
self,
626+
fx: &mut FunctionCx<'_, '_, 'tcx>,
627+
ty: Ty<'tcx>,
628+
) -> CPlace<'tcx> {
629+
CPlace { inner: self.inner, layout: fx.layout_of(ty) }
630+
}
631+
624632
pub(crate) fn place_field(
625633
self,
626634
fx: &mut FunctionCx<'_, '_, 'tcx>,

0 commit comments

Comments
 (0)