Skip to content

Commit 41f6bad

Browse files
eddybalexcrichton
authored andcommitted
Rename expected_types_for_fn_args to expected_inputs_for_expected_output.
1 parent ce32daa commit 41f6bad

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/librustc_typeck/check/callee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
254254

255255
// Call the generic checker.
256256
let expected_arg_tys =
257-
self.expected_types_for_fn_args(call_expr.span,
257+
self.expected_inputs_for_expected_output(call_expr.span,
258258
expected,
259259
fn_sig.output(),
260260
fn_sig.inputs());
@@ -280,7 +280,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
280280
// do know the types expected for each argument and the return
281281
// type.
282282

283-
let expected_arg_tys = self.expected_types_for_fn_args(call_expr.span,
283+
let expected_arg_tys = self.expected_inputs_for_expected_output(call_expr.span,
284284
expected,
285285
fn_sig.output().clone(),
286286
fn_sig.inputs());

src/librustc_typeck/check/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)