Skip to content

Commit a7454d1

Browse files
committed
ProjectionElem::Subtype -> CastKind::Subtype
1 parent 2898222 commit a7454d1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
789789
let operand = codegen_operand(fx, operand);
790790
crate::unsize::coerce_unsized_into(fx, operand, lval);
791791
}
792-
Rvalue::Cast(CastKind::Transmute, ref operand, _to_ty) => {
792+
Rvalue::Cast(CastKind::Transmute | CastKind::Subtype, ref operand, _to_ty) => {
793793
let operand = codegen_operand(fx, operand);
794794
lval.write_cvalue_transmute(fx, operand);
795795
}
@@ -996,7 +996,7 @@ pub(crate) fn codegen_place<'tcx>(
996996
cplace = cplace.place_deref(fx);
997997
}
998998
PlaceElem::OpaqueCast(ty) => bug!("encountered OpaqueCast({ty}) in codegen"),
999-
PlaceElem::Subtype(ty) | PlaceElem::UnwrapUnsafeBinder(ty) => {
999+
PlaceElem::UnwrapUnsafeBinder(ty) => {
10001000
cplace = cplace.place_transmute_type(fx, fx.monomorphize(ty));
10011001
}
10021002
PlaceElem::Field(field, _ty) => {

src/value_and_place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ impl<'tcx> CPlace<'tcx> {
660660
}
661661
}
662662

663-
/// Used for `ProjectionElem::Subtype`, `ty` has to be monomorphized before
663+
/// Used for `ProjectionElem::UnwrapUnsafeBinder`, `ty` has to be monomorphized before
664664
/// passed on.
665665
pub(crate) fn place_transmute_type(
666666
self,

0 commit comments

Comments
 (0)