aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model_impl/function.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/code_model_impl/function.rs')
-rw-r--r--crates/ra_hir/src/code_model_impl/function.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_hir/src/code_model_impl/function.rs b/crates/ra_hir/src/code_model_impl/function.rs
index 1ce939e05..8d6b7fc19 100644
--- a/crates/ra_hir/src/code_model_impl/function.rs
+++ b/crates/ra_hir/src/code_model_impl/function.rs
@@ -42,7 +42,8 @@ impl FnSignature {
42 .name() 42 .name()
43 .map(|n| n.as_name()) 43 .map(|n| n.as_name())
44 .unwrap_or_else(Name::missing); 44 .unwrap_or_else(Name::missing);
45 let mut args = Vec::new(); 45 let mut params = Vec::new();
46 let mut has_self_param = false;
46 if let Some(param_list) = node.param_list() { 47 if let Some(param_list) = node.param_list() {
47 if let Some(self_param) = param_list.self_param() { 48 if let Some(self_param) = param_list.self_param() {
48 let self_type = if let Some(type_ref) = self_param.type_ref() { 49 let self_type = if let Some(type_ref) = self_param.type_ref() {
@@ -59,11 +60,12 @@ impl FnSignature {
59 } 60 }
60 } 61 }
61 }; 62 };
62 args.push(self_type); 63 params.push(self_type);
64 has_self_param = true;
63 } 65 }
64 for param in param_list.params() { 66 for param in param_list.params() {
65 let type_ref = TypeRef::from_ast_opt(param.type_ref()); 67 let type_ref = TypeRef::from_ast_opt(param.type_ref());
66 args.push(type_ref); 68 params.push(type_ref);
67 } 69 }
68 } 70 }
69 let ret_type = if let Some(type_ref) = node.ret_type().and_then(|rt| rt.type_ref()) { 71 let ret_type = if let Some(type_ref) = node.ret_type().and_then(|rt| rt.type_ref()) {
@@ -73,8 +75,9 @@ impl FnSignature {
73 }; 75 };
74 let sig = FnSignature { 76 let sig = FnSignature {
75 name, 77 name,
76 args, 78 params,
77 ret_type, 79 ret_type,
80 has_self_param,
78 }; 81 };
79 Arc::new(sig) 82 Arc::new(sig)
80 } 83 }