diff options
author | Jonas Schievink <[email protected]> | 2021-04-05 02:50:10 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-05 02:50:10 +0100 |
commit | 7c0c713a102ee86ee32af115acba63a5c3b3a657 (patch) | |
tree | efa1f5aee1521d720bc6e83db26b53f00d7562a0 /crates/hir_ty/src/utils.rs | |
parent | adcf18e27dc04b60fede859f3d6c22b99d4fd513 (diff) |
Intern `GenericParams`
Also share the same instance between `ItemTree` and `generic_params`
query.
Diffstat (limited to 'crates/hir_ty/src/utils.rs')
-rw-r--r-- | crates/hir_ty/src/utils.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/hir_ty/src/utils.rs b/crates/hir_ty/src/utils.rs index c85c328af..df0ea4368 100644 --- a/crates/hir_ty/src/utils.rs +++ b/crates/hir_ty/src/utils.rs | |||
@@ -9,6 +9,7 @@ use hir_def::{ | |||
9 | generics::{ | 9 | generics::{ |
10 | GenericParams, TypeParamData, TypeParamProvenance, WherePredicate, WherePredicateTypeTarget, | 10 | GenericParams, TypeParamData, TypeParamProvenance, WherePredicate, WherePredicateTypeTarget, |
11 | }, | 11 | }, |
12 | intern::Interned, | ||
12 | path::Path, | 13 | path::Path, |
13 | resolver::{HasResolver, TypeNs}, | 14 | resolver::{HasResolver, TypeNs}, |
14 | type_ref::TypeRef, | 15 | type_ref::TypeRef, |
@@ -158,7 +159,7 @@ pub(crate) fn generics(db: &dyn DefDatabase, def: GenericDefId) -> Generics { | |||
158 | #[derive(Debug)] | 159 | #[derive(Debug)] |
159 | pub(crate) struct Generics { | 160 | pub(crate) struct Generics { |
160 | def: GenericDefId, | 161 | def: GenericDefId, |
161 | pub(crate) params: Arc<GenericParams>, | 162 | pub(crate) params: Interned<GenericParams>, |
162 | parent_generics: Option<Box<Generics>>, | 163 | parent_generics: Option<Box<Generics>>, |
163 | } | 164 | } |
164 | 165 | ||