mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-14 17:07:26 +00:00
Add fn parent_fn()
accessors for hir::Param
& hir::SelfParam
This commit is contained in:
parent
223238d9e7
commit
1afeea85ff
1 changed files with 8 additions and 0 deletions
|
@ -2108,6 +2108,10 @@ pub struct Param {
|
|||
}
|
||||
|
||||
impl Param {
|
||||
pub fn parent_fn(&self) -> Function {
|
||||
self.func
|
||||
}
|
||||
|
||||
pub fn ty(&self) -> &Type {
|
||||
&self.ty
|
||||
}
|
||||
|
@ -2172,6 +2176,10 @@ impl SelfParam {
|
|||
.map(|value| InFile { file_id, value })
|
||||
}
|
||||
|
||||
pub fn parent_fn(&self) -> Function {
|
||||
Function::from(self.func)
|
||||
}
|
||||
|
||||
pub fn ty(&self, db: &dyn HirDatabase) -> Type {
|
||||
let substs = TyBuilder::placeholder_subst(db, self.func);
|
||||
let callable_sig =
|
||||
|
|
Loading…
Reference in a new issue