aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-05-24 14:13:23 +0100
committerJonas Schievink <[email protected]>2021-05-24 14:13:23 +0100
commit8ebb8d29e18d7cb18bd2b57b004dcecd65a96232 (patch)
treec50b52fe4c8ba204a924cc141544b7df4994edfb /crates/hir_def/src/item_tree.rs
parent05fc97e31b1d04bf5d5885edd98a1510f0931a62 (diff)
internal: intern `TypeBound`s
Doesn't save much memory (~2 mb), but interning things is generally a good pattern to follow
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r--crates/hir_def/src/item_tree.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index 4a5f44027..11767d100 100644
--- a/crates/hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
@@ -644,7 +644,7 @@ pub struct Trait {
644 pub generic_params: Interned<GenericParams>, 644 pub generic_params: Interned<GenericParams>,
645 pub is_auto: bool, 645 pub is_auto: bool,
646 pub is_unsafe: bool, 646 pub is_unsafe: bool,
647 pub bounds: Box<[TypeBound]>, 647 pub bounds: Box<[Interned<TypeBound>]>,
648 pub items: Box<[AssocItem]>, 648 pub items: Box<[AssocItem]>,
649 pub ast_id: FileAstId<ast::Trait>, 649 pub ast_id: FileAstId<ast::Trait>,
650} 650}
@@ -664,7 +664,7 @@ pub struct TypeAlias {
664 pub name: Name, 664 pub name: Name,
665 pub visibility: RawVisibilityId, 665 pub visibility: RawVisibilityId,
666 /// Bounds on the type alias itself. Only valid in trait declarations, eg. `type Assoc: Copy;`. 666 /// Bounds on the type alias itself. Only valid in trait declarations, eg. `type Assoc: Copy;`.
667 pub bounds: Box<[TypeBound]>, 667 pub bounds: Box<[Interned<TypeBound>]>,
668 pub generic_params: Interned<GenericParams>, 668 pub generic_params: Interned<GenericParams>,
669 pub type_ref: Option<Interned<TypeRef>>, 669 pub type_ref: Option<Interned<TypeRef>>,
670 pub is_extern: bool, 670 pub is_extern: bool,