@@ -2321,7 +2321,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2321
2321
match method_fn_ty. sty {
2322
2322
ty:: TyFnDef ( def_id, .., ref fty) => {
2323
2323
// HACK(eddyb) ignore self in the definition (see above).
2324
- let expected_arg_tys = self . expected_types_for_fn_args (
2324
+ let expected_arg_tys = self . expected_inputs_for_expected_output (
2325
2325
sp,
2326
2326
expected,
2327
2327
fty. 0 . output ( ) ,
@@ -2674,14 +2674,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2674
2674
TypeAndSubsts { substs : substs, ty : substd_ty }
2675
2675
}
2676
2676
2677
- /// Unifies the return type with the expected type early, for more coercions
2678
- /// and forward type information on the argument expressions.
2679
- fn expected_types_for_fn_args ( & self ,
2680
- call_span : Span ,
2681
- expected_ret : Expectation < ' tcx > ,
2682
- formal_ret : Ty < ' tcx > ,
2683
- formal_args : & [ Ty < ' tcx > ] )
2684
- -> Vec < Ty < ' tcx > > {
2677
+ /// Unifies the output type with the expected type early, for more coercions
2678
+ /// and forward type information on the input expressions.
2679
+ fn expected_inputs_for_expected_output ( & self ,
2680
+ call_span : Span ,
2681
+ expected_ret : Expectation < ' tcx > ,
2682
+ formal_ret : Ty < ' tcx > ,
2683
+ formal_args : & [ Ty < ' tcx > ] )
2684
+ -> Vec < Ty < ' tcx > > {
2685
2685
let expected_args = expected_ret. only_has_type ( self ) . and_then ( |ret_ty| {
2686
2686
self . fudge_regions_if_ok ( & RegionVariableOrigin :: Coercion ( call_span) , || {
2687
2687
// Attempt to apply a subtyping relationship between the formal
@@ -2704,7 +2704,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2704
2704
} ) . collect ( ) )
2705
2705
} ) . ok ( )
2706
2706
} ) . unwrap_or ( vec ! [ ] ) ;
2707
- debug ! ( "expected_types_for_fn_args (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
2707
+ debug ! ( "expected_inputs_for_expected_output (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
2708
2708
formal_args, formal_ret,
2709
2709
expected_args, expected_ret) ;
2710
2710
expected_args
0 commit comments