diff options
author | Jonas Schievink <[email protected]> | 2021-05-24 14:13:23 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-05-24 14:13:23 +0100 |
commit | 8ebb8d29e18d7cb18bd2b57b004dcecd65a96232 (patch) | |
tree | c50b52fe4c8ba204a924cc141544b7df4994edfb /crates/hir_ty/src/lower.rs | |
parent | 05fc97e31b1d04bf5d5885edd98a1510f0931a62 (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_ty/src/lower.rs')
-rw-r--r-- | crates/hir_ty/src/lower.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index 8a375b973..1645ac533 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs | |||
@@ -10,6 +10,7 @@ use std::{iter, sync::Arc}; | |||
10 | 10 | ||
11 | use base_db::CrateId; | 11 | use base_db::CrateId; |
12 | use chalk_ir::{cast::Cast, fold::Shift, interner::HasInterner, Mutability, Safety}; | 12 | use chalk_ir::{cast::Cast, fold::Shift, interner::HasInterner, Mutability, Safety}; |
13 | use hir_def::intern::Interned; | ||
13 | use hir_def::{ | 14 | use hir_def::{ |
14 | adt::StructKind, | 15 | adt::StructKind, |
15 | body::{Expander, LowerCtx}, | 16 | body::{Expander, LowerCtx}, |
@@ -843,7 +844,7 @@ impl<'a> TyLoweringContext<'a> { | |||
843 | }) | 844 | }) |
844 | } | 845 | } |
845 | 846 | ||
846 | fn lower_impl_trait(&self, bounds: &[TypeBound]) -> ReturnTypeImplTrait { | 847 | fn lower_impl_trait(&self, bounds: &[Interned<TypeBound>]) -> ReturnTypeImplTrait { |
847 | cov_mark::hit!(lower_rpit); | 848 | cov_mark::hit!(lower_rpit); |
848 | let self_ty = | 849 | let self_ty = |
849 | TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)).intern(&Interner); | 850 | TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)).intern(&Interner); |