@@ -24,7 +24,7 @@ pub(crate) use llvm::codegen_llvm_intrinsic_call;
2424use rustc_middle:: ty;
2525use rustc_middle:: ty:: layout:: { HasParamEnv , ValidityRequirement } ;
2626use rustc_middle:: ty:: print:: { with_no_trimmed_paths, with_no_visible_paths} ;
27- use rustc_middle:: ty:: subst :: SubstsRef ;
27+ use rustc_middle:: ty:: GenericArgsRef ;
2828use rustc_span:: symbol:: { kw, sym, Symbol } ;
2929
3030use crate :: prelude:: * ;
@@ -213,13 +213,13 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
213213 source_info : mir:: SourceInfo ,
214214) {
215215 let intrinsic = fx. tcx . item_name ( instance. def_id ( ) ) ;
216- let substs = instance. substs ;
216+ let instance_args = instance. args ;
217217
218218 if intrinsic. as_str ( ) . starts_with ( "simd_" ) {
219219 self :: simd:: codegen_simd_intrinsic_call (
220220 fx,
221221 intrinsic,
222- substs ,
222+ instance_args ,
223223 args,
224224 destination,
225225 target. expect ( "target for simd intrinsic" ) ,
@@ -233,7 +233,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
233233 fx,
234234 instance,
235235 intrinsic,
236- substs ,
236+ instance_args ,
237237 args,
238238 destination,
239239 target,
@@ -365,7 +365,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
365365 fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
366366 instance : Instance < ' tcx > ,
367367 intrinsic : Symbol ,
368- substs : SubstsRef < ' tcx > ,
368+ generic_args : GenericArgsRef < ' tcx > ,
369369 args : & [ mir:: Operand < ' tcx > ] ,
370370 ret : CPlace < ' tcx > ,
371371 destination : Option < BasicBlock > ,
@@ -394,7 +394,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
394394 let dst = dst. load_scalar ( fx) ;
395395 let count = count. load_scalar ( fx) ;
396396
397- let elem_ty = substs . type_at ( 0 ) ;
397+ let elem_ty = generic_args . type_at ( 0 ) ;
398398 let elem_size: u64 = fx. layout_of ( elem_ty) . size . bytes ( ) ;
399399 assert_eq ! ( args. len( ) , 3 ) ;
400400 let byte_amount =
@@ -410,7 +410,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
410410 let src = src. load_scalar ( fx) ;
411411 let count = count. load_scalar ( fx) ;
412412
413- let elem_ty = substs . type_at ( 0 ) ;
413+ let elem_ty = generic_args . type_at ( 0 ) ;
414414 let elem_size: u64 = fx. layout_of ( elem_ty) . size . bytes ( ) ;
415415 assert_eq ! ( args. len( ) , 3 ) ;
416416 let byte_amount =
@@ -428,7 +428,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
428428 sym:: size_of_val => {
429429 intrinsic_args ! ( fx, args => ( ptr) ; intrinsic) ;
430430
431- let layout = fx. layout_of ( substs . type_at ( 0 ) ) ;
431+ let layout = fx. layout_of ( generic_args . type_at ( 0 ) ) ;
432432 // Note: Can't use is_unsized here as truly unsized types need to take the fixed size
433433 // branch
434434 let size = if let Abi :: ScalarPair ( _, _) = ptr. layout ( ) . abi {
@@ -443,7 +443,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
443443 sym:: min_align_of_val => {
444444 intrinsic_args ! ( fx, args => ( ptr) ; intrinsic) ;
445445
446- let layout = fx. layout_of ( substs . type_at ( 0 ) ) ;
446+ let layout = fx. layout_of ( generic_args . type_at ( 0 ) ) ;
447447 // Note: Can't use is_unsized here as truly unsized types need to take the fixed size
448448 // branch
449449 let align = if let Abi :: ScalarPair ( _, _) = ptr. layout ( ) . abi {
@@ -602,7 +602,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
602602 sym:: assert_inhabited | sym:: assert_zero_valid | sym:: assert_mem_uninitialized_valid => {
603603 intrinsic_args ! ( fx, args => ( ) ; intrinsic) ;
604604
605- let ty = substs . type_at ( 0 ) ;
605+ let ty = generic_args . type_at ( 0 ) ;
606606
607607 let requirement = ValidityRequirement :: from_intrinsic ( intrinsic) ;
608608
@@ -674,7 +674,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
674674 intrinsic_args ! ( fx, args => ( ptr, base) ; intrinsic) ;
675675 let ptr = ptr. load_scalar ( fx) ;
676676 let base = base. load_scalar ( fx) ;
677- let ty = substs . type_at ( 0 ) ;
677+ let ty = generic_args . type_at ( 0 ) ;
678678
679679 let pointee_size: u64 = fx. layout_of ( ty) . size . bytes ( ) ;
680680 let diff_bytes = fx. bcx . ins ( ) . isub ( ptr, base) ;
@@ -720,7 +720,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
720720 intrinsic_args ! ( fx, args => ( ptr) ; intrinsic) ;
721721 let ptr = ptr. load_scalar ( fx) ;
722722
723- let ty = substs . type_at ( 0 ) ;
723+ let ty = generic_args . type_at ( 0 ) ;
724724 match ty. kind ( ) {
725725 ty:: Uint ( UintTy :: U128 ) | ty:: Int ( IntTy :: I128 ) => {
726726 // FIXME implement 128bit atomics
@@ -751,7 +751,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
751751 intrinsic_args ! ( fx, args => ( ptr, val) ; intrinsic) ;
752752 let ptr = ptr. load_scalar ( fx) ;
753753
754- let ty = substs . type_at ( 0 ) ;
754+ let ty = generic_args . type_at ( 0 ) ;
755755 match ty. kind ( ) {
756756 ty:: Uint ( UintTy :: U128 ) | ty:: Int ( IntTy :: I128 ) => {
757757 // FIXME implement 128bit atomics
@@ -1128,7 +1128,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
11281128 let lhs_ref = lhs_ref. load_scalar ( fx) ;
11291129 let rhs_ref = rhs_ref. load_scalar ( fx) ;
11301130
1131- let size = fx. layout_of ( substs . type_at ( 0 ) ) . layout . size ( ) ;
1131+ let size = fx. layout_of ( generic_args . type_at ( 0 ) ) . layout . size ( ) ;
11321132 // FIXME add and use emit_small_memcmp
11331133 let is_eq_value = if size == Size :: ZERO {
11341134 // No bytes means they're trivially equal
0 commit comments