about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2022-05-31 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2022-05-31 00:00:00 +0000
commite60087505e8550fb6867fbcee2294fbfcf706f7f (patch)
tree4e69b11c31918b72416541c60a86ab15a720f75c
parentd27ec6c86d0c3464b5da71c86f0db53ff59242c0 (diff)
downloadrust-e60087505e8550fb6867fbcee2294fbfcf706f7f.tar.gz
rust-e60087505e8550fb6867fbcee2294fbfcf706f7f.zip
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.
-rw-r--r--src/base.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/base.rs b/src/base.rs
index 3fe112d794b..7c59ce354c0 100644
--- a/src/base.rs
+++ b/src/base.rs
@@ -607,7 +607,7 @@ fn codegen_stmt<'tcx>(
                     let operand = codegen_operand(fx, operand);
                     lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
                 }
-                Rvalue::Cast(CastKind::Misc, ref operand, to_ty) => {
+                Rvalue::Cast(CastKind::Misc | CastKind::PointerAddress, ref operand, to_ty) => {
                     let operand = codegen_operand(fx, operand);
                     let from_ty = operand.layout().ty;
                     let to_ty = fx.monomorphize(to_ty);