]> git.lizzy.rs Git - rust.git/commitdiff
Rename expected_types_for_fn_args to expected_inputs_for_expected_output.
authorEduard-Mihai Burtescu <edy.burt@gmail.com>
Thu, 9 Mar 2017 19:05:56 +0000 (21:05 +0200)
committerEduard-Mihai Burtescu <edy.burt@gmail.com>
Thu, 9 Mar 2017 19:05:56 +0000 (21:05 +0200)
src/librustc_typeck/check/callee.rs
src/librustc_typeck/check/mod.rs

index 4b88f5acf42da2415ea3442fec3c06440ef307b2..529ee107c46cee8db04acf0ff6f9ba53801b757a 100644 (file)
@@ -254,7 +254,7 @@ fn confirm_builtin_call(&self,
 
         // Call the generic checker.
         let expected_arg_tys =
-            self.expected_types_for_fn_args(call_expr.span,
+            self.expected_inputs_for_expected_output(call_expr.span,
                                             expected,
                                             fn_sig.output(),
                                             fn_sig.inputs());
@@ -280,7 +280,7 @@ fn confirm_deferred_closure_call(&self,
         // do know the types expected for each argument and the return
         // type.
 
-        let expected_arg_tys = self.expected_types_for_fn_args(call_expr.span,
+        let expected_arg_tys = self.expected_inputs_for_expected_output(call_expr.span,
                                                                expected,
                                                                fn_sig.output().clone(),
                                                                fn_sig.inputs());
index e8957bad0986c28e380da5d2bc0284a88a03821b..847aea553534dae4f8fb8919c711aca4a3067fce 100644 (file)
@@ -2321,7 +2321,7 @@ fn check_method_argument_types(&self,
             match method_fn_ty.sty {
                 ty::TyFnDef(def_id, .., ref fty) => {
                     // HACK(eddyb) ignore self in the definition (see above).
-                    let expected_arg_tys = self.expected_types_for_fn_args(
+                    let expected_arg_tys = self.expected_inputs_for_expected_output(
                         sp,
                         expected,
                         fty.0.output(),
@@ -2674,14 +2674,14 @@ pub fn impl_self_ty(&self,
         TypeAndSubsts { substs: substs, ty: substd_ty }
     }
 
-    /// Unifies the return type with the expected type early, for more coercions
-    /// and forward type information on the argument expressions.
-    fn expected_types_for_fn_args(&self,
-                                  call_span: Span,
-                                  expected_ret: Expectation<'tcx>,
-                                  formal_ret: Ty<'tcx>,
-                                  formal_args: &[Ty<'tcx>])
-                                  -> Vec<Ty<'tcx>> {
+    /// Unifies the output type with the expected type early, for more coercions
+    /// and forward type information on the input expressions.
+    fn expected_inputs_for_expected_output(&self,
+                                           call_span: Span,
+                                           expected_ret: Expectation<'tcx>,
+                                           formal_ret: Ty<'tcx>,
+                                           formal_args: &[Ty<'tcx>])
+                                           -> Vec<Ty<'tcx>> {
         let expected_args = expected_ret.only_has_type(self).and_then(|ret_ty| {
             self.fudge_regions_if_ok(&RegionVariableOrigin::Coercion(call_span), || {
                 // Attempt to apply a subtyping relationship between the formal
@@ -2704,7 +2704,7 @@ fn expected_types_for_fn_args(&self,
                 }).collect())
             }).ok()
         }).unwrap_or(vec![]);
-        debug!("expected_types_for_fn_args(formal={:?} -> {:?}, expected={:?} -> {:?})",
+        debug!("expected_inputs_for_expected_output(formal={:?} -> {:?}, expected={:?} -> {:?})",
                formal_args, formal_ret,
                expected_args, expected_ret);
         expected_args