@@ -2292,7 +2292,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2292
2292
match method_fn_ty. sty {
2293
2293
ty:: TyFnDef ( def_id, .., ref fty) => {
2294
2294
// 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 (
2296
2296
sp,
2297
2297
expected,
2298
2298
fty. 0 . output ( ) ,
@@ -2645,14 +2645,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2645
2645
TypeAndSubsts { substs : substs, ty : substd_ty }
2646
2646
}
2647
2647
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 > > {
2656
2656
let expected_args = expected_ret. only_has_type ( self ) . and_then ( |ret_ty| {
2657
2657
self . fudge_regions_if_ok ( & RegionVariableOrigin :: Coercion ( call_span) , || {
2658
2658
// Attempt to apply a subtyping relationship between the formal
@@ -2675,7 +2675,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2675
2675
} ) . collect ( ) )
2676
2676
} ) . ok ( )
2677
2677
} ) . unwrap_or ( vec ! [ ] ) ;
2678
- debug ! ( "expected_types_for_fn_args (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
2678
+ debug ! ( "expected_inputs_for_expected_output (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
2679
2679
formal_args, formal_ret,
2680
2680
expected_args, expected_ret) ;
2681
2681
expected_args
0 commit comments