@@ -26,7 +26,8 @@ fn equate_intrinsic_type<'tcx>(
26
26
sig : ty:: PolyFnSig < ' tcx > ,
27
27
) {
28
28
let ( own_counts, span) = match tcx. hir_node_by_def_id ( def_id) {
29
- hir:: Node :: ForeignItem ( hir:: ForeignItem {
29
+ hir:: Node :: Item ( hir:: Item { kind : hir:: ItemKind :: Fn ( _, generics, _) , .. } )
30
+ | hir:: Node :: ForeignItem ( hir:: ForeignItem {
30
31
kind : hir:: ForeignItemKind :: Fn ( .., generics) ,
31
32
..
32
33
} ) => {
@@ -135,9 +136,14 @@ pub fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -
135
136
136
137
/// Remember to add all intrinsics here, in `compiler/rustc_codegen_llvm/src/intrinsic.rs`,
137
138
/// and in `library/core/src/intrinsics.rs`.
138
- pub fn check_intrinsic_type ( tcx : TyCtxt < ' _ > , intrinsic_id : LocalDefId , span : Span ) {
139
+ pub fn check_intrinsic_type (
140
+ tcx : TyCtxt < ' _ > ,
141
+ intrinsic_id : LocalDefId ,
142
+ span : Span ,
143
+ intrinsic_name : Symbol ,
144
+ abi : Abi ,
145
+ ) {
139
146
let param = |n| Ty :: new_param ( tcx, n, Symbol :: intern ( & format ! ( "P{n}" ) ) ) ;
140
- let intrinsic_name = tcx. item_name ( intrinsic_id. into ( ) ) ;
141
147
let name_str = intrinsic_name. as_str ( ) ;
142
148
143
149
let bound_vars = tcx. mk_bound_variable_kinds ( & [
@@ -468,7 +474,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId, span: Spa
468
474
469
475
sym:: black_box => ( 1 , 0 , vec ! [ param( 0 ) ] , param ( 0 ) ) ,
470
476
471
- sym:: is_val_statically_known => ( 1 , 0 , vec ! [ param( 0 ) ] , tcx. types . bool ) ,
477
+ sym:: is_val_statically_known => ( 1 , 1 , vec ! [ param( 0 ) ] , tcx. types . bool ) ,
472
478
473
479
sym:: const_eval_select => ( 4 , 0 , vec ! [ param( 0 ) , param( 1 ) , param( 2 ) ] , param ( 3 ) ) ,
474
480
@@ -483,7 +489,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId, span: Spa
483
489
} ;
484
490
( n_tps, 0 , n_cts, inputs, output, unsafety)
485
491
} ;
486
- let sig = tcx. mk_fn_sig ( inputs, output, false , unsafety, Abi :: RustIntrinsic ) ;
492
+ let sig = tcx. mk_fn_sig ( inputs, output, false , unsafety, abi ) ;
487
493
let sig = ty:: Binder :: bind_with_vars ( sig, bound_vars) ;
488
494
equate_intrinsic_type ( tcx, span, intrinsic_id, n_tps, n_lts, n_cts, sig)
489
495
}
0 commit comments