Skip to content

Commit d89c480

Browse files
committed
Sync from rust 839222065a44ac21c15df68ed2f2f3c0127b0b8e
2 parents b038641 + cc00f45 commit d89c480

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
@@ -813,7 +813,7 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
813813
let operand = codegen_operand(fx, operand);
814814
crate::unsize::coerce_unsized_into(fx, operand, lval);
815815
}
816-
Rvalue::Cast(CastKind::Transmute, ref operand, _to_ty) => {
816+
Rvalue::Cast(CastKind::Transmute | CastKind::Subtype, ref operand, _to_ty) => {
817817
let operand = codegen_operand(fx, operand);
818818
lval.write_cvalue_transmute(fx, operand);
819819
}
@@ -1020,7 +1020,7 @@ pub(crate) fn codegen_place<'tcx>(
10201020
cplace = cplace.place_deref(fx);
10211021
}
10221022
PlaceElem::OpaqueCast(ty) => bug!("encountered OpaqueCast({ty}) in codegen"),
1023-
PlaceElem::Subtype(ty) | PlaceElem::UnwrapUnsafeBinder(ty) => {
1023+
PlaceElem::UnwrapUnsafeBinder(ty) => {
10241024
cplace = cplace.place_transmute_type(fx, fx.monomorphize(ty));
10251025
}
10261026
PlaceElem::Field(field, _ty) => {

src/value_and_place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ impl<'tcx> CPlace<'tcx> {
653653
}
654654
}
655655

656-
/// Used for `ProjectionElem::Subtype`, `ty` has to be monomorphized before
656+
/// Used for `ProjectionElem::UnwrapUnsafeBinder`, `ty` has to be monomorphized before
657657
/// passed on.
658658
pub(crate) fn place_transmute_type(
659659
self,

0 commit comments

Comments
 (0)