aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/utils.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-05 02:50:10 +0100
committerJonas Schievink <[email protected]>2021-04-05 02:50:10 +0100
commit7c0c713a102ee86ee32af115acba63a5c3b3a657 (patch)
treeefa1f5aee1521d720bc6e83db26b53f00d7562a0 /crates/hir_ty/src/utils.rs
parentadcf18e27dc04b60fede859f3d6c22b99d4fd513 (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.rs3
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)]
159pub(crate) struct Generics { 160pub(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