Skip to content

Commit 22d2e34

Browse files
bors[bot]matklad
andauthored
Merge #5815
5815: Introduce hir::Param r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents e8d266f + 70fd542 commit 22d2e34

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

crates/hir/src/code_model.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,13 @@ impl Function {
673673
Some(SelfParam { func: self.id })
674674
}
675675

676-
pub fn params(self, db: &dyn HirDatabase) -> Vec<TypeRef> {
677-
db.function_data(self.id).params.clone()
676+
pub fn params(self, db: &dyn HirDatabase) -> Vec<Param> {
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()
678683
}
679684

680685
pub fn is_unsafe(self, db: &dyn HirDatabase) -> bool {
@@ -707,6 +712,10 @@ pub struct SelfParam {
707712
func: FunctionId,
708713
}
709714

715+
pub struct Param {
716+
_ty: (),
717+
}
718+
710719
impl SelfParam {
711720
pub fn access(self, db: &dyn HirDatabase) -> Access {
712721
let func_data = db.function_data(self.func);

0 commit comments

Comments
 (0)