@@ -583,7 +583,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
583583 intrinsic_args ! ( fx, args => ( base, offset) ; intrinsic) ;
584584 let offset = offset. load_scalar ( fx) ;
585585
586- let pointee_ty = base. layout ( ) . ty . builtin_deref ( true ) . unwrap ( ) ;
586+ let pointee_ty = base. layout ( ) . ty . builtin_deref ( true , fx . tcx ) . unwrap ( ) ;
587587 let pointee_size = fx. layout_of ( pointee_ty) . size . bytes ( ) ;
588588 let ptr_diff = if pointee_size != 1 {
589589 fx. bcx . ins ( ) . imul_imm ( offset, pointee_size as i64 )
@@ -609,7 +609,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
609609 let val = val. load_scalar ( fx) ;
610610 let count = count. load_scalar ( fx) ;
611611
612- let pointee_ty = dst. layout ( ) . ty . builtin_deref ( true ) . unwrap ( ) ;
612+ let pointee_ty = dst. layout ( ) . ty . builtin_deref ( true , fx . tcx ) . unwrap ( ) ;
613613 let pointee_size = fx. layout_of ( pointee_ty) . size . bytes ( ) ;
614614 let count = if pointee_size != 1 {
615615 fx. bcx . ins ( ) . imul_imm ( count, pointee_size as i64 )
@@ -717,7 +717,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
717717
718718 // Cranelift treats loads as volatile by default
719719 // FIXME correctly handle unaligned_volatile_load
720- let inner_layout = fx. layout_of ( ptr. layout ( ) . ty . builtin_deref ( true ) . unwrap ( ) ) ;
720+ let inner_layout = fx. layout_of ( ptr. layout ( ) . ty . builtin_deref ( true , fx . tcx ) . unwrap ( ) ) ;
721721 let val = CValue :: by_ref ( Pointer :: new ( ptr. load_scalar ( fx) ) , inner_layout) ;
722722 ret. write_cvalue ( fx, val) ;
723723 }
0 commit comments