diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-03 14:41:13 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-03 14:41:13 +0000 |
commit | fd84df9e1bb231f7aa4bcf760e0aff0a6bd10e9f (patch) | |
tree | 57fbfe241dcd571b9376b23260299160e0312246 /crates/hir_ty/src | |
parent | 93ecef53a370703a67f87b90c4640d3e8bf73934 (diff) | |
parent | 63744fe128193464eb0ce63fbe6c30c4f98b6135 (diff) |
Merge #7541
7541: Use block_def_map in body lowering (third time's the charm) r=jonas-schievink a=jonas-schievink
After https://github.com/rust-analyzer/rust-analyzer/pull/7380 and https://github.com/rust-analyzer/rust-analyzer/pull/7506 both had to be reverted, this should have finally resolved all remaining bugs.
Most importantly, the optimization to skip `block_def_map` computation when the block contains no inner items was fixed (which fortunately was simpler than expected).
I've ran `analysis-stats` on libstd locally, which works fine, and also ran this PR locally for a short while without issues.
Note that this *still* has no (or almost no) user-facing impact, because the rest of r-a still relies on some local item support hacks.
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index d7351d212..12f1591c8 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -137,7 +137,7 @@ impl<'a> InferenceContext<'a> { | |||
137 | 137 | ||
138 | self.coerce_merge_branch(&then_ty, &else_ty) | 138 | self.coerce_merge_branch(&then_ty, &else_ty) |
139 | } | 139 | } |
140 | Expr::Block { statements, tail, label } => match label { | 140 | Expr::Block { statements, tail, label, id: _ } => match label { |
141 | Some(_) => { | 141 | Some(_) => { |
142 | let break_ty = self.table.new_type_var(); | 142 | let break_ty = self.table.new_type_var(); |
143 | self.breakables.push(BreakableContext { | 143 | self.breakables.push(BreakableContext { |