aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/expr.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-06 14:43:37 +0100
committerGitHub <[email protected]>2021-04-06 14:43:37 +0100
commit7d39b13996e312a8a738ed0dfccab45978fc42f8 (patch)
tree91761b9bf78d9015fbb6083b9245eb9f6133e234 /crates/hir_ty/src/infer/expr.rs
parent12e86433ab57ee8b1c96b8da0480fd311752487b (diff)
parent4e2a6ac7eae3ff193962421cc3c86e5d8f9a7e31 (diff)
Merge #8364
8364: Memory usage improvements r=jonas-schievink a=alexmaco These are mostly focused on splitting up enum variants with large size differences between variants by `Box`-ing things up. In my testing this reduces the memory usage somewhere in the low percentages, even though the measurements are quite noisy. Co-authored-by: Alexandru Macovei <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer/expr.rs')
-rw-r--r--crates/hir_ty/src/infer/expr.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs
index dab137ae1..5b3cdab4e 100644
--- a/crates/hir_ty/src/infer/expr.rs
+++ b/crates/hir_ty/src/infer/expr.rs
@@ -318,7 +318,13 @@ impl<'a> InferenceContext<'a> {
318 self.normalize_associated_types_in(ret_ty) 318 self.normalize_associated_types_in(ret_ty)
319 } 319 }
320 Expr::MethodCall { receiver, args, method_name, generic_args } => self 320 Expr::MethodCall { receiver, args, method_name, generic_args } => self
321 .infer_method_call(tgt_expr, *receiver, &args, &method_name, generic_args.as_ref()), 321 .infer_method_call(
322 tgt_expr,
323 *receiver,
324 &args,
325 &method_name,
326 generic_args.as_deref(),
327 ),
322 Expr::Match { expr, arms } => { 328 Expr::Match { expr, arms } => {
323 let input_ty = self.infer_expr(*expr, &Expectation::none()); 329 let input_ty = self.infer_expr(*expr, &Expectation::none());
324 330
@@ -399,7 +405,7 @@ impl<'a> InferenceContext<'a> {
399 TyKind::Never.intern(&Interner) 405 TyKind::Never.intern(&Interner)
400 } 406 }
401 Expr::RecordLit { path, fields, spread } => { 407 Expr::RecordLit { path, fields, spread } => {
402 let (ty, def_id) = self.resolve_variant(path.as_ref()); 408 let (ty, def_id) = self.resolve_variant(path.as_deref());
403 if let Some(variant) = def_id { 409 if let Some(variant) = def_id {
404 self.write_variant_resolution(tgt_expr.into(), variant); 410 self.write_variant_resolution(tgt_expr.into(), variant);
405 } 411 }