aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model_impl/function.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-01-07 12:44:54 +0000
committerFlorian Diebold <[email protected]>2019-01-12 14:01:19 +0000
commit082ef52bcb15d779c6aff78d9860d328bf7df9b2 (patch)
treea4a123ad491e15c8d17bdc815675d43bb33811b5 /crates/ra_hir/src/code_model_impl/function.rs
parente9e397e705ad0bec9775067b10109e35ebefc493 (diff)
Implement basic inherent method resolution
Diffstat (limited to 'crates/ra_hir/src/code_model_impl/function.rs')
-rw-r--r--crates/ra_hir/src/code_model_impl/function.rs3
1 files changed, 3 insertions, 0 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..77dddff79 100644
--- a/crates/ra_hir/src/code_model_impl/function.rs
+++ b/crates/ra_hir/src/code_model_impl/function.rs
@@ -43,6 +43,7 @@ impl FnSignature {
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 args = Vec::new();
46 let mut has_self_arg = 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() {
@@ -60,6 +61,7 @@ impl FnSignature {
60 } 61 }
61 }; 62 };
62 args.push(self_type); 63 args.push(self_type);
64 has_self_arg = 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());
@@ -75,6 +77,7 @@ impl FnSignature {
75 name, 77 name,
76 args, 78 args,
77 ret_type, 79 ret_type,
80 has_self_arg,
78 }; 81 };
79 Arc::new(sig) 82 Arc::new(sig)
80 } 83 }