diff options
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 7 |
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 | ||
863 | impl 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)] |
864 | pub struct ImplBlock { | 871 | pub struct ImplBlock { |
865 | pub(crate) id: ImplId, | 872 | pub(crate) id: ImplId, |