aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/pat.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-08 17:25:18 +0100
committerFlorian Diebold <[email protected]>2021-04-08 21:48:47 +0100
commitbe03db0e3a75533f34d48c3014d532919b30a9e9 (patch)
tree3742a817b8238043a3a855d92532c7342815210e /crates/hir_ty/src/infer/pat.rs
parenta169fa6a832a513cd1534d1a6566e4584ca5fb6a (diff)
Intern Substitutions
(Costs a bit of performance, reduces memory usage on RA by ~10%.)
Diffstat (limited to 'crates/hir_ty/src/infer/pat.rs')
-rw-r--r--crates/hir_ty/src/infer/pat.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs
index a41e8e116..aea354cde 100644
--- a/crates/hir_ty/src/infer/pat.rs
+++ b/crates/hir_ty/src/infer/pat.rs
@@ -122,7 +122,7 @@ impl<'a> InferenceContext<'a> {
122 let ty = match &body[pat] { 122 let ty = match &body[pat] {
123 &Pat::Tuple { ref args, ellipsis } => { 123 &Pat::Tuple { ref args, ellipsis } => {
124 let expectations = match expected.as_tuple() { 124 let expectations = match expected.as_tuple() {
125 Some(parameters) => &*parameters.interned().as_slice(), 125 Some(parameters) => &*parameters.as_slice(&Interner),
126 _ => &[], 126 _ => &[],
127 }; 127 };
128 128
@@ -242,7 +242,7 @@ impl<'a> InferenceContext<'a> {
242 let (inner_ty, alloc_ty) = match expected.as_adt() { 242 let (inner_ty, alloc_ty) = match expected.as_adt() {
243 Some((adt, subst)) if adt == box_adt => ( 243 Some((adt, subst)) if adt == box_adt => (
244 subst.at(&Interner, 0).assert_ty_ref(&Interner).clone(), 244 subst.at(&Interner, 0).assert_ty_ref(&Interner).clone(),
245 subst.interned().get(1).and_then(|a| a.ty(&Interner).cloned()), 245 subst.as_slice(&Interner).get(1).and_then(|a| a.ty(&Interner).cloned()),
246 ), 246 ),
247 _ => (self.result.standard_types.unknown.clone(), None), 247 _ => (self.result.standard_types.unknown.clone(), None),
248 }; 248 };