Skip to content

Commit 46928b8

Browse files
eddybbrson
authored andcommitted
Rename expected_types_for_fn_args to expected_inputs_for_expected_output.
1 parent 64a3b62 commit 46928b8

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
@@ -258,7 +258,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
258258

259259
// Call the generic checker.
260260
let expected_arg_tys =
261-
self.expected_types_for_fn_args(call_expr.span,
261+
self.expected_inputs_for_expected_output(call_expr.span,
262262
expected,
263263
fn_sig.output(),
264264
fn_sig.inputs());
@@ -284,7 +284,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
284284
// do know the types expected for each argument and the return
285285
// type.
286286

287-
let expected_arg_tys = self.expected_types_for_fn_args(call_expr.span,
287+
let expected_arg_tys = self.expected_inputs_for_expected_output(call_expr.span,
288288
expected,
289289
fn_sig.output().clone(),
290290
fn_sig.inputs());

src/librustc_typeck/check/mod.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -2411,7 +2411,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
24112411
match method_fn_ty.sty {
24122412
ty::TyFnDef(def_id, .., ref fty) => {
24132413
// 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(
24152415
sp,
24162416
expected,
24172417
fty.sig.0.output(),
@@ -2764,14 +2764,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
27642764
TypeAndSubsts { substs: substs, ty: substd_ty }
27652765
}
27662766

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>> {
27752775
let expected_args = expected_ret.only_has_type(self).and_then(|ret_ty| {
27762776
self.fudge_regions_if_ok(&RegionVariableOrigin::Coercion(call_span), || {
27772777
// Attempt to apply a subtyping relationship between the formal
@@ -2794,7 +2794,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
27942794
}).collect())
27952795
}).ok()
27962796
}).unwrap_or(vec![]);
2797-
debug!("expected_types_for_fn_args(formal={:?} -> {:?}, expected={:?} -> {:?})",
2797+
debug!("expected_inputs_for_expected_output(formal={:?} -> {:?}, expected={:?} -> {:?})",
27982798
formal_args, formal_ret,
27992799
expected_args, expected_ret);
28002800
expected_args

0 commit comments

Comments
 (0)