@@ -741,19 +741,18 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
741
741
helper : TerminatorCodegenHelper < ' tcx > ,
742
742
bx : & mut Bx ,
743
743
terminator : & mir:: Terminator < ' tcx > ,
744
- func : & mir:: Operand < ' tcx > ,
744
+ func : & Spanned < mir:: Operand < ' tcx > > ,
745
745
args : & [ Spanned < mir:: Operand < ' tcx > > ] ,
746
746
destination : mir:: Place < ' tcx > ,
747
747
target : Option < mir:: BasicBlock > ,
748
748
unwind : mir:: UnwindAction ,
749
- fn_span : Span ,
750
749
mergeable_succ : bool ,
751
750
) -> MergingSucc {
752
751
let source_info = terminator. source_info ;
753
752
let span = source_info. span ;
754
753
755
754
// Create the callee. This is a fn ptr or zero-sized and hence a kind of scalar.
756
- let callee = self . codegen_operand ( bx, func) ;
755
+ let callee = self . codegen_operand ( bx, & func. node ) ;
757
756
758
757
let ( instance, mut llfn) = match * callee. layout . ty . kind ( ) {
759
758
ty:: FnDef ( def_id, args) => (
@@ -829,8 +828,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
829
828
830
829
if intrinsic == Some ( sym:: caller_location) {
831
830
return if let Some ( target) = target {
832
- let location =
833
- self . get_caller_location ( bx, mir:: SourceInfo { span : fn_span , ..source_info } ) ;
831
+ let location = self
832
+ . get_caller_location ( bx, mir:: SourceInfo { span : func . span , ..source_info } ) ;
834
833
835
834
if let ReturnDest :: IndirectOperand ( tmp, _) = ret_dest {
836
835
location. val . store ( bx, tmp) ;
@@ -1019,16 +1018,17 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1019
1018
} else {
1020
1019
args. len ( )
1021
1020
} ;
1021
+ let fn_span = func. span ;
1022
1022
assert_eq ! (
1023
1023
fn_abi. args. len( ) ,
1024
1024
mir_args + 1 ,
1025
1025
"#[track_caller] fn's must have 1 more argument in their ABI than in their MIR: {instance:?} {fn_span:?} {fn_abi:?}" ,
1026
1026
) ;
1027
1027
let location =
1028
- self . get_caller_location ( bx, mir:: SourceInfo { span : fn_span , ..source_info } ) ;
1028
+ self . get_caller_location ( bx, mir:: SourceInfo { span : func . span , ..source_info } ) ;
1029
1029
debug ! (
1030
- "codegen_call_terminator({:?}): location={:?} (fn_span {:?})" ,
1031
- terminator, location, fn_span
1030
+ "codegen_call_terminator({:?}): location={:?} (func.span {:?})" ,
1031
+ terminator, location, func . span
1032
1032
) ;
1033
1033
1034
1034
let last_arg = fn_abi. args . last ( ) . unwrap ( ) ;
@@ -1256,7 +1256,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1256
1256
target,
1257
1257
unwind,
1258
1258
call_source : _,
1259
- fn_span,
1260
1259
} => self . codegen_call_terminator (
1261
1260
helper,
1262
1261
bx,
@@ -1266,7 +1265,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1266
1265
destination,
1267
1266
target,
1268
1267
unwind,
1269
- fn_span,
1270
1268
mergeable_succ ( ) ,
1271
1269
) ,
1272
1270
mir:: TerminatorKind :: CoroutineDrop | mir:: TerminatorKind :: Yield { .. } => {
0 commit comments