aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-08 22:11:53 +0100
committerGitHub <[email protected]>2021-04-08 22:11:53 +0100
commita75763cd57ac6d9cd08846770b8c5f5ba27122df (patch)
treed33b6ca6fc37c3eaf19980926fa2dd0d59e66b43 /crates/hir_ty/src/lib.rs
parent63726a91b721e119622e0c7ea106fc5c2e866bf3 (diff)
parent37ff15ad835ee4ba6d231cac8b1adbd301aec20b (diff)
Merge #8433
8433: Intern lots of things r=jonas-schievink a=flodiebold This uses the new interning infrastructure for most type-related things, where it had a positive effect on memory usage and performance. In total, this gives a slight performance improvement and a quite good memory reduction (1119MB->885MB on RA, 1774MB->1188MB on Diesel). Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index 874c95411..beb58d711 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -109,7 +109,7 @@ pub type WhereClause = chalk_ir::WhereClause<Interner>;
109pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { 109pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution {
110 Substitution::from_iter( 110 Substitution::from_iter(
111 &Interner, 111 &Interner,
112 s.interned()[..std::cmp::min(s.len(&Interner), n)].iter().cloned(), 112 s.as_slice(&Interner)[..std::cmp::min(s.len(&Interner), n)].iter().cloned(),
113 ) 113 )
114} 114}
115 115
@@ -187,7 +187,7 @@ impl CallableSig {
187 .shifted_out_to(&Interner, DebruijnIndex::ONE) 187 .shifted_out_to(&Interner, DebruijnIndex::ONE)
188 .expect("unexpected lifetime vars in fn ptr") 188 .expect("unexpected lifetime vars in fn ptr")
189 .0 189 .0
190 .interned() 190 .as_slice(&Interner)
191 .iter() 191 .iter()
192 .map(|arg| arg.assert_ty_ref(&Interner).clone()) 192 .map(|arg| arg.assert_ty_ref(&Interner).clone())
193 .collect(), 193 .collect(),