@@ -222,21 +222,21 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
222222 } ;
223223
224224 // 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 ) ,
227227 _ => bug ! ( "invalid args" ) ,
228228 } ;
229- let fn_source = Instance :: mono ( tcx , * source_id) ;
229+ let fn_source = Instance :: new_raw ( * source_id, source_args ) ;
230230 let source_symbol =
231231 symbol_name_for_instance_in_crate ( tcx, fn_source. clone ( ) , LOCAL_CRATE ) ;
232232 let fn_to_diff: Option < & ' ll llvm:: Value > = self . cx . get_function ( & source_symbol) ;
233233 let Some ( fn_to_diff) = fn_to_diff else { bug ! ( "could not find source function" ) } ;
234234
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 ) ,
237237 _ => bug ! ( "invalid args" ) ,
238238 } ;
239- let fn_diff = Instance :: mono ( tcx , * diff_id) ;
239+ let fn_diff = Instance :: new_raw ( * diff_id, diff_args ) ;
240240 let diff_symbol =
241241 symbol_name_for_instance_in_crate ( tcx, fn_diff. clone ( ) , LOCAL_CRATE ) ;
242242
0 commit comments