@@ -2292,7 +2292,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
22922292 match method_fn_ty. sty {
22932293 ty:: TyFnDef ( def_id, .., ref fty) => {
22942294 // HACK(eddyb) ignore self in the definition (see above).
2295- let expected_arg_tys = self . expected_types_for_fn_args (
2295+ let expected_arg_tys = self . expected_inputs_for_expected_output (
22962296 sp,
22972297 expected,
22982298 fty. 0 . output ( ) ,
@@ -2645,14 +2645,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
26452645 TypeAndSubsts { substs : substs, ty : substd_ty }
26462646 }
26472647
2648- /// Unifies the return type with the expected type early, for more coercions
2649- /// and forward type information on the argument expressions.
2650- fn expected_types_for_fn_args ( & self ,
2651- call_span : Span ,
2652- expected_ret : Expectation < ' tcx > ,
2653- formal_ret : Ty < ' tcx > ,
2654- formal_args : & [ Ty < ' tcx > ] )
2655- -> Vec < Ty < ' tcx > > {
2648+ /// Unifies the output type with the expected type early, for more coercions
2649+ /// and forward type information on the input expressions.
2650+ fn expected_inputs_for_expected_output ( & self ,
2651+ call_span : Span ,
2652+ expected_ret : Expectation < ' tcx > ,
2653+ formal_ret : Ty < ' tcx > ,
2654+ formal_args : & [ Ty < ' tcx > ] )
2655+ -> Vec < Ty < ' tcx > > {
26562656 let expected_args = expected_ret. only_has_type ( self ) . and_then ( |ret_ty| {
26572657 self . fudge_regions_if_ok ( & RegionVariableOrigin :: Coercion ( call_span) , || {
26582658 // Attempt to apply a subtyping relationship between the formal
@@ -2675,7 +2675,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
26752675 } ) . collect ( ) )
26762676 } ) . ok ( )
26772677 } ) . unwrap_or ( vec ! [ ] ) ;
2678- debug ! ( "expected_types_for_fn_args (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
2678+ debug ! ( "expected_inputs_for_expected_output (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
26792679 formal_args, formal_ret,
26802680 expected_args, expected_ret) ;
26812681 expected_args
0 commit comments