diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-02 17:43:16 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-02 17:43:16 +0100 |
commit | f4d56989b657b15aec6675cf1ba697e3f87eb088 (patch) | |
tree | 23e4d8265444257f2e4018a003659a711fde0414 /crates/hir_ty | |
parent | 9bcdbefc7b657f34704439d068113180b14359dc (diff) | |
parent | 6e227b80a7686a7ea5bc039d54c307fda29c99ba (diff) |
Merge #8284
8284: Reduce memory usage by using global `Arc`-based interning r=jonas-schievink a=jonas-schievink
This saves around 50 mb when running `analysis-stats` on r-a itself. Not a lot, but this infra can be easily reused to intern more stuff.
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_ty')
-rw-r--r-- | crates/hir_ty/src/lower.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index 018621131..72ee060e0 100644 --- a/crates/hir_ty/src/lower.rs +++ b/crates/hir_ty/src/lower.rs | |||
@@ -1154,7 +1154,7 @@ fn type_for_type_alias(db: &dyn HirDatabase, t: TypeAliasId) -> Binders<Ty> { | |||
1154 | Binders::new(0, TyKind::ForeignType(crate::to_foreign_def_id(t)).intern(&Interner)) | 1154 | Binders::new(0, TyKind::ForeignType(crate::to_foreign_def_id(t)).intern(&Interner)) |
1155 | } else { | 1155 | } else { |
1156 | let type_ref = &db.type_alias_data(t).type_ref; | 1156 | let type_ref = &db.type_alias_data(t).type_ref; |
1157 | let inner = ctx.lower_ty(type_ref.as_ref().unwrap_or(&TypeRef::Error)); | 1157 | let inner = ctx.lower_ty(type_ref.as_deref().unwrap_or(&TypeRef::Error)); |
1158 | Binders::new(generics.len(), inner) | 1158 | Binders::new(generics.len(), inner) |
1159 | } | 1159 | } |
1160 | } | 1160 | } |