aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
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);