diff options
author | Florian Diebold <[email protected]> | 2019-01-12 20:58:16 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-01-12 20:58:16 +0000 |
commit | 1ed7fbfc1badd2c2a42b4dc2feb1b4bf7835d3ef (patch) | |
tree | 8e0a5cd3e1981bf0ff9615636d45566dd85fdb97 /crates/ra_hir/src/ty.rs | |
parent | 5db5f5cc1dc5dfbded866b59570afc50538b9091 (diff) |
args -> params
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 2dcba5283..5d5568d69 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -432,7 +432,7 @@ fn type_for_fn(db: &impl HirDatabase, f: Function) -> Cancelable<Ty> { | |||
432 | let impl_block = f.impl_block(db)?; | 432 | let impl_block = f.impl_block(db)?; |
433 | // TODO we ignore type parameters for now | 433 | // TODO we ignore type parameters for now |
434 | let input = signature | 434 | let input = signature |
435 | .args() | 435 | .params() |
436 | .iter() | 436 | .iter() |
437 | .map(|tr| Ty::from_hir(db, &module, impl_block.as_ref(), tr)) | 437 | .map(|tr| Ty::from_hir(db, &module, impl_block.as_ref(), tr)) |
438 | .collect::<Cancelable<Vec<_>>>()?; | 438 | .collect::<Cancelable<Vec<_>>>()?; |
@@ -876,7 +876,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
876 | } | 876 | } |
877 | Expr::Call { callee, args } => { | 877 | Expr::Call { callee, args } => { |
878 | let callee_ty = self.infer_expr(*callee, &Expectation::none())?; | 878 | let callee_ty = self.infer_expr(*callee, &Expectation::none())?; |
879 | let (arg_tys, ret_ty) = match &callee_ty { | 879 | let (param_tys, ret_ty) = match &callee_ty { |
880 | Ty::FnPtr(sig) => (&sig.input[..], sig.output.clone()), | 880 | Ty::FnPtr(sig) => (&sig.input[..], sig.output.clone()), |
881 | _ => { | 881 | _ => { |
882 | // not callable | 882 | // not callable |
@@ -887,7 +887,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
887 | for (i, arg) in args.iter().enumerate() { | 887 | for (i, arg) in args.iter().enumerate() { |
888 | self.infer_expr( | 888 | self.infer_expr( |
889 | *arg, | 889 | *arg, |
890 | &Expectation::has_type(arg_tys.get(i).cloned().unwrap_or(Ty::Unknown)), | 890 | &Expectation::has_type(param_tys.get(i).cloned().unwrap_or(Ty::Unknown)), |
891 | )?; | 891 | )?; |
892 | } | 892 | } |
893 | ret_ty | 893 | ret_ty |
@@ -904,7 +904,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
904 | None => Ty::Unknown, | 904 | None => Ty::Unknown, |
905 | }; | 905 | }; |
906 | let method_ty = self.insert_type_vars(method_ty); | 906 | let method_ty = self.insert_type_vars(method_ty); |
907 | let (expected_receiver_ty, arg_tys, ret_ty) = match &method_ty { | 907 | let (expected_receiver_ty, param_tys, ret_ty) = match &method_ty { |
908 | Ty::FnPtr(sig) => { | 908 | Ty::FnPtr(sig) => { |
909 | if sig.input.len() > 0 { | 909 | if sig.input.len() > 0 { |
910 | (&sig.input[0], &sig.input[1..], sig.output.clone()) | 910 | (&sig.input[0], &sig.input[1..], sig.output.clone()) |
@@ -920,7 +920,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
920 | for (i, arg) in args.iter().enumerate() { | 920 | for (i, arg) in args.iter().enumerate() { |
921 | self.infer_expr( | 921 | self.infer_expr( |
922 | *arg, | 922 | *arg, |
923 | &Expectation::has_type(arg_tys.get(i).cloned().unwrap_or(Ty::Unknown)), | 923 | &Expectation::has_type(param_tys.get(i).cloned().unwrap_or(Ty::Unknown)), |
924 | )?; | 924 | )?; |
925 | } | 925 | } |
926 | ret_ty | 926 | ret_ty |
@@ -1093,7 +1093,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
1093 | 1093 | ||
1094 | fn collect_fn_signature(&mut self, signature: &FnSignature) -> Cancelable<()> { | 1094 | fn collect_fn_signature(&mut self, signature: &FnSignature) -> Cancelable<()> { |
1095 | let body = Arc::clone(&self.body); // avoid borrow checker problem | 1095 | let body = Arc::clone(&self.body); // avoid borrow checker problem |
1096 | for (type_ref, pat) in signature.args().iter().zip(body.args()) { | 1096 | for (type_ref, pat) in signature.params().iter().zip(body.params()) { |
1097 | let ty = self.make_ty(type_ref)?; | 1097 | let ty = self.make_ty(type_ref)?; |
1098 | let ty = self.insert_type_vars(ty); | 1098 | let ty = self.insert_type_vars(ty); |
1099 | self.write_pat_ty(*pat, ty); | 1099 | self.write_pat_ty(*pat, ty); |