ProjectionElem::Subtype -> CastKind::Subtype

This commit is contained in:
beepster4096
2025-09-25 20:54:54 -07:00
parent 289822299a
commit a7454d1880
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -789,7 +789,7 @@ fn is_wide_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
let operand = codegen_operand(fx, operand);
crate::unsize::coerce_unsized_into(fx, operand, lval);
}
Rvalue::Cast(CastKind::Transmute, ref operand, _to_ty) => {
Rvalue::Cast(CastKind::Transmute | CastKind::Subtype, ref operand, _to_ty) => {
let operand = codegen_operand(fx, operand);
lval.write_cvalue_transmute(fx, operand);
}
@@ -996,7 +996,7 @@ pub(crate) fn codegen_place<'tcx>(
cplace = cplace.place_deref(fx);
}
PlaceElem::OpaqueCast(ty) => bug!("encountered OpaqueCast({ty}) in codegen"),
PlaceElem::Subtype(ty) | PlaceElem::UnwrapUnsafeBinder(ty) => {
PlaceElem::UnwrapUnsafeBinder(ty) => {
cplace = cplace.place_transmute_type(fx, fx.monomorphize(ty));
}
PlaceElem::Field(field, _ty) => {
+1 -1
View File
@@ -660,7 +660,7 @@ fn transmute_scalar<'tcx>(
}
}
/// Used for `ProjectionElem::Subtype`, `ty` has to be monomorphized before
/// Used for `ProjectionElem::UnwrapUnsafeBinder`, `ty` has to be monomorphized before
/// passed on.
pub(crate) fn place_transmute_type(
self,