diff options
author | Florian Diebold <[email protected]> | 2021-04-08 17:25:18 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-08 21:48:47 +0100 |
commit | be03db0e3a75533f34d48c3014d532919b30a9e9 (patch) | |
tree | 3742a817b8238043a3a855d92532c7342815210e /crates/hir_ty/src/traits/chalk/mapping.rs | |
parent | a169fa6a832a513cd1534d1a6566e4584ca5fb6a (diff) |
Intern Substitutions
(Costs a bit of performance, reduces memory usage on RA by ~10%.)
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(); |