@@ -2411,7 +2411,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
24112411 match method_fn_ty. sty {
24122412 ty:: TyFnDef ( def_id, .., ref fty) => {
24132413 // HACK(eddyb) ignore self in the definition (see above).
2414- let expected_arg_tys = self . expected_types_for_fn_args (
2414+ let expected_arg_tys = self . expected_inputs_for_expected_output (
24152415 sp,
24162416 expected,
24172417 fty. sig . 0 . output ( ) ,
@@ -2764,14 +2764,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
27642764 TypeAndSubsts { substs : substs, ty : substd_ty }
27652765 }
27662766
2767- /// Unifies the return type with the expected type early, for more coercions
2768- /// and forward type information on the argument expressions.
2769- fn expected_types_for_fn_args ( & self ,
2770- call_span : Span ,
2771- expected_ret : Expectation < ' tcx > ,
2772- formal_ret : Ty < ' tcx > ,
2773- formal_args : & [ Ty < ' tcx > ] )
2774- -> Vec < Ty < ' tcx > > {
2767+ /// Unifies the output type with the expected type early, for more coercions
2768+ /// and forward type information on the input expressions.
2769+ fn expected_inputs_for_expected_output ( & self ,
2770+ call_span : Span ,
2771+ expected_ret : Expectation < ' tcx > ,
2772+ formal_ret : Ty < ' tcx > ,
2773+ formal_args : & [ Ty < ' tcx > ] )
2774+ -> Vec < Ty < ' tcx > > {
27752775 let expected_args = expected_ret. only_has_type ( self ) . and_then ( |ret_ty| {
27762776 self . fudge_regions_if_ok ( & RegionVariableOrigin :: Coercion ( call_span) , || {
27772777 // Attempt to apply a subtyping relationship between the formal
@@ -2794,7 +2794,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
27942794 } ) . collect ( ) )
27952795 } ) . ok ( )
27962796 } ) . unwrap_or ( vec ! [ ] ) ;
2797- debug ! ( "expected_types_for_fn_args (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
2797+ debug ! ( "expected_inputs_for_expected_output (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
27982798 formal_args, formal_ret,
27992799 expected_args, expected_ret) ;
28002800 expected_args
0 commit comments