@@ -170,6 +170,8 @@ pub(crate) fn check_intrinsic_type(
170
170
}
171
171
} ;
172
172
173
+ let has_autodiff = tcx. has_attr ( intrinsic_id, sym:: rustc_autodiff) ;
174
+
173
175
let bound_vars = tcx. mk_bound_variable_kinds ( & [
174
176
ty:: BoundVariableKind :: Region ( ty:: BoundRegionKind :: Anon ) ,
175
177
ty:: BoundVariableKind :: Region ( ty:: BoundRegionKind :: Anon ) ,
@@ -197,6 +199,17 @@ pub(crate) fn check_intrinsic_type(
197
199
let safety = intrinsic_operation_unsafety ( tcx, intrinsic_id) ;
198
200
let n_lts = 0 ;
199
201
let ( n_tps, n_cts, inputs, output) = match intrinsic_name {
202
+ _ if has_autodiff => {
203
+ let sig = tcx. fn_sig ( intrinsic_id. to_def_id ( ) ) ;
204
+ let sig = sig. skip_binder ( ) ;
205
+ let n_tps = generics. own_counts ( ) . types ;
206
+ let n_cts = generics. own_counts ( ) . consts ;
207
+
208
+ let inputs = sig. skip_binder ( ) . inputs ( ) . to_vec ( ) ;
209
+ let output = sig. skip_binder ( ) . output ( ) ;
210
+
211
+ ( n_tps, n_cts, inputs, output)
212
+ }
200
213
sym:: abort => ( 0 , 0 , vec ! [ ] , tcx. types . never ) ,
201
214
sym:: unreachable => ( 0 , 0 , vec ! [ ] , tcx. types . never ) ,
202
215
sym:: breakpoint => ( 0 , 0 , vec ! [ ] , tcx. types . unit ) ,
0 commit comments