@@ -224,21 +224,21 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
224224 } ;
225225
226226 // Get source, diff, and attrs
227- let source_id = match fn_args. into_type_list ( tcx) [ 0 ] . kind ( ) {
228- ty:: FnDef ( def_id, _ ) => def_id,
227+ let ( source_id, source_args ) = match fn_args. into_type_list ( tcx) [ 0 ] . kind ( ) {
228+ ty:: FnDef ( def_id, source_params ) => ( def_id, source_params ) ,
229229 _ => bug ! ( "invalid args" ) ,
230230 } ;
231- let fn_source = Instance :: mono ( tcx , * source_id) ;
231+ let fn_source = Instance :: new_raw ( * source_id, source_args ) ;
232232 let source_symbol =
233233 symbol_name_for_instance_in_crate ( tcx, fn_source. clone ( ) , LOCAL_CRATE ) ;
234234 let fn_to_diff: Option < & ' ll llvm:: Value > = self . cx . get_function ( & source_symbol) ;
235235 let Some ( fn_to_diff) = fn_to_diff else { bug ! ( "could not find source function" ) } ;
236236
237- let diff_id = match fn_args. into_type_list ( tcx) [ 1 ] . kind ( ) {
238- ty:: FnDef ( def_id, _ ) => def_id,
237+ let ( diff_id, diff_args ) = match fn_args. into_type_list ( tcx) [ 1 ] . kind ( ) {
238+ ty:: FnDef ( def_id, diff_args ) => ( def_id, diff_args ) ,
239239 _ => bug ! ( "invalid args" ) ,
240240 } ;
241- let fn_diff = Instance :: mono ( tcx , * diff_id) ;
241+ let fn_diff = Instance :: new_raw ( * diff_id, diff_args ) ;
242242 let diff_symbol =
243243 symbol_name_for_instance_in_crate ( tcx, fn_diff. clone ( ) , LOCAL_CRATE ) ;
244244
0 commit comments