aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-08-19 15:04:11 +0100
committerAleksey Kladov <[email protected]>2020-08-19 15:04:18 +0100
commit70fd5428226bfc6c75314a987a643b8e7d82fb31 (patch)
tree3268a6ff56b652188ab175129ce7d9fed552ad01 /crates
parente8d266fa6dd7ee883d1bba52eb6a37c5e473978f (diff)
Introduce hir::Param
We generally shouldn't expose TypeRef out of hir. So, let's just use a placehoder here.
Diffstat (limited to 'crates')
-rw-r--r--crates/hir/src/code_model.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 3254f316b..68ccedc60 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -673,8 +673,13 @@ impl Function {
673 Some(SelfParam { func: self.id }) 673 Some(SelfParam { func: self.id })
674 } 674 }
675 675
676 pub fn params(self, db: &dyn HirDatabase) -> Vec<TypeRef> { 676 pub fn params(self, db: &dyn HirDatabase) -> Vec<Param> {
677 db.function_data(self.id).params.clone() 677 db.function_data(self.id)
678 .params
679 .iter()
680 .skip(if self.self_param(db).is_some() { 1 } else { 0 })
681 .map(|_| Param { _ty: () })
682 .collect()
678 } 683 }
679 684
680 pub fn is_unsafe(self, db: &dyn HirDatabase) -> bool { 685 pub fn is_unsafe(self, db: &dyn HirDatabase) -> bool {
@@ -707,6 +712,10 @@ pub struct SelfParam {
707 func: FunctionId, 712 func: FunctionId,
708} 713}
709 714
715pub struct Param {
716 _ty: (),
717}
718
710impl SelfParam { 719impl SelfParam {
711 pub fn access(self, db: &dyn HirDatabase) -> Access { 720 pub fn access(self, db: &dyn HirDatabase) -> Access {
712 let func_data = db.function_data(self.func); 721 let func_data = db.function_data(self.func);