mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Intern Substitutions
(Costs a bit of performance, reduces memory usage on RA by ~10%.)
This commit is contained in:
parent
a169fa6a83
commit
be03db0e3a
8 changed files with 34 additions and 27 deletions
|
@ -109,7 +109,7 @@ pub type WhereClause = chalk_ir::WhereClause<Interner>;
|
|||
pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution {
|
||||
Substitution::from_iter(
|
||||
&Interner,
|
||||
s.interned()[..std::cmp::min(s.len(&Interner), n)].iter().cloned(),
|
||||
s.as_slice(&Interner)[..std::cmp::min(s.len(&Interner), n)].iter().cloned(),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ impl CallableSig {
|
|||
.shifted_out_to(&Interner, DebruijnIndex::ONE)
|
||||
.expect("unexpected lifetime vars in fn ptr")
|
||||
.0
|
||||
.interned()
|
||||
.as_slice(&Interner)
|
||||
.iter()
|
||||
.map(|arg| arg.assert_ty_ref(&Interner).clone())
|
||||
.collect(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue