Skip to content

Commit e600875

Browse files
committed
Add a pointer to address cast kind
A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.
1 parent d27ec6c commit e600875

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ fn codegen_stmt<'tcx>(
607607
let operand = codegen_operand(fx, operand);
608608
lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
609609
}
610-
Rvalue::Cast(CastKind::Misc, ref operand, to_ty) => {
610+
Rvalue::Cast(CastKind::Misc | CastKind::PointerAddress, ref operand, to_ty) => {
611611
let operand = codegen_operand(fx, operand);
612612
let from_ty = operand.layout().ty;
613613
let to_ty = fx.monomorphize(to_ty);

0 commit comments

Comments
 (0)