Unnamed repository; edit this file 'description' to name the repository.
Merge pull request #20046 from regexident/type-param-parent-getter
Add `fn parent(self, db) -> GenericDef` to `hir::TypeParam`
Florian Diebold 10 months ago
parent dc2e14d · parent 90f3921 · commit b0552d7
-rw-r--r--crates/hir/src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index c4f5a7ef58..3b39707cf6 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -4150,6 +4150,10 @@ impl TypeParam {
self.merge().name(db)
}
+ pub fn parent(self, _db: &dyn HirDatabase) -> GenericDef {
+ self.id.parent().into()
+ }
+
pub fn module(self, db: &dyn HirDatabase) -> Module {
self.id.parent().module(db).into()
}