@@ -170,6 +170,8 @@ pub(crate) fn check_intrinsic_type(
170170 }
171171 } ;
172172
173+ let has_autodiff = tcx. has_attr ( intrinsic_id, sym:: rustc_autodiff) ;
174+
173175 let bound_vars = tcx. mk_bound_variable_kinds ( & [
174176 ty:: BoundVariableKind :: Region ( ty:: BoundRegionKind :: Anon ) ,
175177 ty:: BoundVariableKind :: Region ( ty:: BoundRegionKind :: Anon ) ,
@@ -197,6 +199,17 @@ pub(crate) fn check_intrinsic_type(
197199 let safety = intrinsic_operation_unsafety ( tcx, intrinsic_id) ;
198200 let n_lts = 0 ;
199201 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+ }
200213 sym:: abort => ( 0 , 0 , vec ! [ ] , tcx. types . never ) ,
201214 sym:: unreachable => ( 0 , 0 , vec ! [ ] , tcx. types . never ) ,
202215 sym:: breakpoint => ( 0 , 0 , vec ! [ ] , tcx. types . unit ) ,
0 commit comments