From 72c34be9752050c1ebacf319d908b98bf2984aa4 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Tue, 13 Nov 2018 18:57:59 +0100 Subject: [PATCH] Implement raw ptr -> int of native pointer size cast --- src/base.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base.rs b/src/base.rs index b9356d40f33..09e78b47f8c 100644 --- a/src/base.rs +++ b/src/base.rs @@ -487,7 +487,8 @@ fn trans_stmt<'a, 'tcx: 'a>( | (ty::RawPtr(..), ty::Int(_)) | (ty::FnPtr(..), ty::Uint(_)) if to_ty.sty == fx.tcx.types.usize.sty - || to_ty.sty == fx.tcx.types.isize.sty => + || to_ty.sty == fx.tcx.types.isize.sty + || fx.clif_type(to_ty).unwrap() == pointer_ty(fx.tcx) => { lval.write_cvalue(fx, operand.unchecked_cast_to(dest_layout)); }