@@ -2411,7 +2411,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2411
2411
match method_fn_ty. sty {
2412
2412
ty:: TyFnDef ( def_id, .., ref fty) => {
2413
2413
// 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 (
2415
2415
sp,
2416
2416
expected,
2417
2417
fty. sig . 0 . output ( ) ,
@@ -2764,14 +2764,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2764
2764
TypeAndSubsts { substs : substs, ty : substd_ty }
2765
2765
}
2766
2766
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 > > {
2775
2775
let expected_args = expected_ret. only_has_type ( self ) . and_then ( |ret_ty| {
2776
2776
self . fudge_regions_if_ok ( & RegionVariableOrigin :: Coercion ( call_span) , || {
2777
2777
// Attempt to apply a subtyping relationship between the formal
@@ -2794,7 +2794,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2794
2794
} ) . collect ( ) )
2795
2795
} ) . ok ( )
2796
2796
} ) . unwrap_or ( vec ! [ ] ) ;
2797
- debug ! ( "expected_types_for_fn_args (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
2797
+ debug ! ( "expected_inputs_for_expected_output (formal={:?} -> {:?}, expected={:?} -> {:?})" ,
2798
2798
formal_args, formal_ret,
2799
2799
expected_args, expected_ret) ;
2800
2800
expected_args
0 commit comments