aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/path/lower.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/path/lower.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/path/lower.rs')
-rw-r--r--crates/hir_def/src/path/lower.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/hir_def/src/path/lower.rs b/crates/hir_def/src/path/lower.rs
index a873325b2..cf4e7c02e 100644
--- a/crates/hir_def/src/path/lower.rs
+++ b/crates/hir_def/src/path/lower.rs
@@ -171,7 +171,9 @@ pub(super) fn lower_generic_args(
171 let name = name_ref.as_name(); 171 let name = name_ref.as_name();
172 let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it)); 172 let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it));
173 let bounds = if let Some(l) = assoc_type_arg.type_bound_list() { 173 let bounds = if let Some(l) = assoc_type_arg.type_bound_list() {
174 l.bounds().map(|it| TypeBound::from_ast(lower_ctx, it)).collect() 174 l.bounds()
175 .map(|it| Interned::new(TypeBound::from_ast(lower_ctx, it)))
176 .collect()
175 } else { 177 } else {
176 Vec::new() 178 Vec::new()
177 }; 179 };