about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
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
commitdff602fc18be295d1b87196a6eee1c72673e6bb8 (patch)
tree3c08934e4fe11ed94c9875185f3e61bcdd1a2484 /compiler/rustc_codegen_cranelift
parentd35d972e6974d40d30362344ea619a5b560aae20 (diff)
downloadrust-dff602fc18be295d1b87196a6eee1c72673e6bb8.tar.gz
rust-dff602fc18be295d1b87196a6eee1c72673e6bb8.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.
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/src/base.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs
index 3fe112d794b..7c59ce354c0 100644
--- a/compiler/rustc_codegen_cranelift/src/base.rs
+++ b/compiler/rustc_codegen_cranelift/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);