@@ -1418,7 +1418,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14181418 ref args,
14191419 ref destination,
14201420 from_hir_call,
1421- fn_span ,
1421+ target ,
14221422 ..
14231423 } => {
14241424 self . check_operand ( func, term_location) ;
@@ -1427,9 +1427,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14271427 }
14281428
14291429 let func_ty = func. ty ( body, tcx) ;
1430- debug ! ( "check_terminator: call, func_ty={:?}" , func_ty) ;
14311430 debug ! ( "func_ty.kind: {:?}" , func_ty. kind( ) ) ;
1432- debug ! ( ?fn_span ) ;
1431+
14331432 let sig = match func_ty. kind ( ) {
14341433 ty:: FnDef ( ..) | ty:: FnPtr ( _) => func_ty. fn_sig ( tcx) ,
14351434 _ => {
@@ -1444,7 +1443,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14441443 ) ;
14451444 debug ! ( ?sig) ;
14461445 let sig = self . normalize ( sig, term_location) ;
1447- self . check_call_dest ( body, term, & sig, destination, target, term_location) ;
1446+ self . check_call_dest ( body, term, & sig, * destination, target, term_location) ;
14481447
14491448 self . prove_predicates (
14501449 sig. inputs_and_output
@@ -1604,24 +1603,19 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
16041603 span_mirbug ! ( self , term, "call to {:?} with wrong # of args" , sig) ;
16051604 }
16061605
1607- let call_arg = if let TerminatorKind :: Call { func, .. } = & term. kind {
1608- let func_ty = func. ty ( body, self . infcx . tcx ) ;
1609- if let ty:: FnDef ( fn_did, substs) = func_ty. kind ( ) {
1610- Some ( ( * fn_did, * substs) )
1611- } else {
1612- None
1613- }
1606+ let func_ty = if let TerminatorKind :: Call { func, .. } = & term. kind {
1607+ Some ( func. ty ( body, self . infcx . tcx ) )
16141608 } else {
16151609 None
16161610 } ;
1617- debug ! ( ?call_arg ) ;
1611+ debug ! ( ?func_ty ) ;
16181612
16191613 for ( n, ( fn_arg, op_arg) ) in iter:: zip ( sig. inputs ( ) , args) . enumerate ( ) {
16201614 let op_arg_ty = op_arg. ty ( body, self . tcx ( ) ) ;
16211615
16221616 let op_arg_ty = self . normalize ( op_arg_ty, term_location) ;
16231617 let category = if from_hir_call {
1624- ConstraintCategory :: CallArgument ( call_arg )
1618+ ConstraintCategory :: CallArgument ( func_ty )
16251619 } else {
16261620 ConstraintCategory :: Boring
16271621 } ;
0 commit comments