@@ -741,19 +741,18 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
741741 helper : TerminatorCodegenHelper < ' tcx > ,
742742 bx : & mut Bx ,
743743 terminator : & mir:: Terminator < ' tcx > ,
744- func : & mir:: Operand < ' tcx > ,
744+ func : & Spanned < mir:: Operand < ' tcx > > ,
745745 args : & [ Spanned < mir:: Operand < ' tcx > > ] ,
746746 destination : mir:: Place < ' tcx > ,
747747 target : Option < mir:: BasicBlock > ,
748748 unwind : mir:: UnwindAction ,
749- fn_span : Span ,
750749 mergeable_succ : bool ,
751750 ) -> MergingSucc {
752751 let source_info = terminator. source_info ;
753752 let span = source_info. span ;
754753
755754 // 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 ) ;
757756
758757 let ( instance, mut llfn) = match * callee. layout . ty . kind ( ) {
759758 ty:: FnDef ( def_id, args) => (
@@ -829,8 +828,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
829828
830829 if intrinsic == Some ( sym:: caller_location) {
831830 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 } ) ;
834833
835834 if let ReturnDest :: IndirectOperand ( tmp, _) = ret_dest {
836835 location. val . store ( bx, tmp) ;
@@ -1019,16 +1018,17 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
10191018 } else {
10201019 args. len ( )
10211020 } ;
1021+ let fn_span = func. span ;
10221022 assert_eq ! (
10231023 fn_abi. args. len( ) ,
10241024 mir_args + 1 ,
10251025 "#[track_caller] fn's must have 1 more argument in their ABI than in their MIR: {instance:?} {fn_span:?} {fn_abi:?}" ,
10261026 ) ;
10271027 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 } ) ;
10291029 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
10321032 ) ;
10331033
10341034 let last_arg = fn_abi. args . last ( ) . unwrap ( ) ;
@@ -1256,7 +1256,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
12561256 target,
12571257 unwind,
12581258 call_source : _,
1259- fn_span,
12601259 } => self . codegen_call_terminator (
12611260 helper,
12621261 bx,
@@ -1266,7 +1265,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
12661265 destination,
12671266 target,
12681267 unwind,
1269- fn_span,
12701268 mergeable_succ ( ) ,
12711269 ) ,
12721270 mir:: TerminatorKind :: CoroutineDrop | mir:: TerminatorKind :: Yield { .. } => {
0 commit comments