diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-08 22:11:53 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-08 22:11:53 +0100 |
commit | a75763cd57ac6d9cd08846770b8c5f5ba27122df (patch) | |
tree | d33b6ca6fc37c3eaf19980926fa2dd0d59e66b43 /crates/hir_ty/src/traits/chalk/mapping.rs | |
parent | 63726a91b721e119622e0c7ea106fc5c2e866bf3 (diff) | |
parent | 37ff15ad835ee4ba6d231cac8b1adbd301aec20b (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/traits/chalk/mapping.rs')
-rw-r--r-- | crates/hir_ty/src/traits/chalk/mapping.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 7818f6387..e78581ea5 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs | |||
@@ -99,7 +99,7 @@ pub(super) fn generic_predicate_to_inline_bound( | |||
99 | // have the expected self type | 99 | // have the expected self type |
100 | return None; | 100 | return None; |
101 | } | 101 | } |
102 | let args_no_self = trait_ref.substitution.interned()[1..] | 102 | let args_no_self = trait_ref.substitution.as_slice(&Interner)[1..] |
103 | .iter() | 103 | .iter() |
104 | .map(|ty| ty.clone().cast(&Interner)) | 104 | .map(|ty| ty.clone().cast(&Interner)) |
105 | .collect(); | 105 | .collect(); |
@@ -111,7 +111,7 @@ pub(super) fn generic_predicate_to_inline_bound( | |||
111 | return None; | 111 | return None; |
112 | } | 112 | } |
113 | let trait_ = projection_ty.trait_(db); | 113 | let trait_ = projection_ty.trait_(db); |
114 | let args_no_self = projection_ty.substitution.interned()[1..] | 114 | let args_no_self = projection_ty.substitution.as_slice(&Interner)[1..] |
115 | .iter() | 115 | .iter() |
116 | .map(|ty| ty.clone().cast(&Interner)) | 116 | .map(|ty| ty.clone().cast(&Interner)) |
117 | .collect(); | 117 | .collect(); |