Skip to content

Commit c7db40f

Browse files
committed
Rename expected_types_for_fn_args to expected_inputs_for_expected_output.
1 parent b04ebef commit c7db40f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/librustc_typeck/check/callee.rs

+2-2
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

+10-10
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
23212321
match method_fn_ty.sty {
23222322
ty::TyFnDef(def_id, .., ref fty) => {
23232323
// 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(
23252325
sp,
23262326
expected,
23272327
fty.0.output(),
@@ -2674,14 +2674,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
26742674
TypeAndSubsts { substs: substs, ty: substd_ty }
26752675
}
26762676

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>> {
26852685
let expected_args = expected_ret.only_has_type(self).and_then(|ret_ty| {
26862686
self.fudge_regions_if_ok(&RegionVariableOrigin::Coercion(call_span), || {
26872687
// Attempt to apply a subtyping relationship between the formal
@@ -2704,7 +2704,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
27042704
}).collect())
27052705
}).ok()
27062706
}).unwrap_or(vec![]);
2707-
debug!("expected_types_for_fn_args(formal={:?} -> {:?}, expected={:?} -> {:?})",
2707+
debug!("expected_inputs_for_expected_output(formal={:?} -> {:?}, expected={:?} -> {:?})",
27082708
formal_args, formal_ret,
27092709
expected_args, expected_ret);
27102710
expected_args

0 commit comments

Comments
 (0)