Introduce hir::Param
We generally shouldn't expose TypeRef out of hir. So, let's just use a placehoder here.
This commit is contained in:
parent
e8d266fa6d
commit
70fd542822
1 changed files with 11 additions and 2 deletions
|
@ -673,8 +673,13 @@ impl Function {
|
|||
Some(SelfParam { func: self.id })
|
||||
}
|
||||
|
||||
pub fn params(self, db: &dyn HirDatabase) -> Vec<TypeRef> {
|
||||
db.function_data(self.id).params.clone()
|
||||
pub fn params(self, db: &dyn HirDatabase) -> Vec<Param> {
|
||||
db.function_data(self.id)
|
||||
.params
|
||||
.iter()
|
||||
.skip(if self.self_param(db).is_some() { 1 } else { 0 })
|
||||
.map(|_| Param { _ty: () })
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn is_unsafe(self, db: &dyn HirDatabase) -> bool {
|
||||
|
@ -707,6 +712,10 @@ pub struct SelfParam {
|
|||
func: FunctionId,
|
||||
}
|
||||
|
||||
pub struct Param {
|
||||
_ty: (),
|
||||
}
|
||||
|
||||
impl SelfParam {
|
||||
pub fn access(self, db: &dyn HirDatabase) -> Access {
|
||||
let func_data = db.function_data(self.func);
|
||||
|
|
Loading…
Add table
Reference in a new issue