aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 29ace8479..8833750c8 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -860,6 +860,13 @@ pub struct GenericParam {
860 pub(crate) id: GenericParamId, 860 pub(crate) id: GenericParamId,
861} 861}
862 862
863impl GenericParam {
864 pub fn name(self, db: &impl HirDatabase) -> Name {
865 let params = db.generic_params(self.id.parent);
866 params.params[self.id.local_id].name.clone()
867 }
868}
869
863#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 870#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
864pub struct ImplBlock { 871pub struct ImplBlock {
865 pub(crate) id: ImplId, 872 pub(crate) id: ImplId,