Skip to content

Commit 1afeea8

Browse files
committed
Add fn parent_fn() accessors for hir::Param & hir::SelfParam
1 parent 223238d commit 1afeea8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/hir/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,10 @@ pub struct Param {
21082108
}
21092109

21102110
impl Param {
2111+
pub fn parent_fn(&self) -> Function {
2112+
self.func
2113+
}
2114+
21112115
pub fn ty(&self) -> &Type {
21122116
&self.ty
21132117
}
@@ -2172,6 +2176,10 @@ impl SelfParam {
21722176
.map(|value| InFile { file_id, value })
21732177
}
21742178

2179+
pub fn parent_fn(&self) -> Function {
2180+
Function::from(self.func)
2181+
}
2182+
21752183
pub fn ty(&self, db: &dyn HirDatabase) -> Type {
21762184
let substs = TyBuilder::placeholder_subst(db, self.func);
21772185
let callable_sig =

0 commit comments

Comments
 (0)