@@ -222,21 +222,21 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
222
222
} ;
223
223
224
224
// Get source, diff, and attrs
225
- let source_id = match fn_args. into_type_list ( tcx) [ 0 ] . kind ( ) {
226
- ty:: FnDef ( def_id, _ ) => def_id,
225
+ let ( source_id, source_args ) = match fn_args. into_type_list ( tcx) [ 0 ] . kind ( ) {
226
+ ty:: FnDef ( def_id, source_params ) => ( def_id, source_params ) ,
227
227
_ => bug ! ( "invalid args" ) ,
228
228
} ;
229
- let fn_source = Instance :: mono ( tcx , * source_id) ;
229
+ let fn_source = Instance :: new_raw ( * source_id, source_args ) ;
230
230
let source_symbol =
231
231
symbol_name_for_instance_in_crate ( tcx, fn_source. clone ( ) , LOCAL_CRATE ) ;
232
232
let fn_to_diff: Option < & ' ll llvm:: Value > = self . cx . get_function ( & source_symbol) ;
233
233
let Some ( fn_to_diff) = fn_to_diff else { bug ! ( "could not find source function" ) } ;
234
234
235
- let diff_id = match fn_args. into_type_list ( tcx) [ 1 ] . kind ( ) {
236
- ty:: FnDef ( def_id, _ ) => def_id,
235
+ let ( diff_id, diff_args ) = match fn_args. into_type_list ( tcx) [ 1 ] . kind ( ) {
236
+ ty:: FnDef ( def_id, diff_args ) => ( def_id, diff_args ) ,
237
237
_ => bug ! ( "invalid args" ) ,
238
238
} ;
239
- let fn_diff = Instance :: mono ( tcx , * diff_id) ;
239
+ let fn_diff = Instance :: new_raw ( * diff_id, diff_args ) ;
240
240
let diff_symbol =
241
241
symbol_name_for_instance_in_crate ( tcx, fn_diff. clone ( ) , LOCAL_CRATE ) ;
242
242
0 commit comments