diff options
author | Lukas Wirth <[email protected]> | 2021-03-21 00:10:59 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-03-21 00:28:42 +0000 |
commit | 64957acb5f359763395a54e314d1f5d5cfc6ccf3 (patch) | |
tree | 00cec518c2cfd88dac252a4aad824372c7afc898 /crates/hir_def/src | |
parent | 62a4677dbc6cf1c90e4558c3c73fef201a0d1080 (diff) |
Fix incorrect scoping in while expressions
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/body/scope.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_def/src/body/scope.rs b/crates/hir_def/src/body/scope.rs index 7f0d8f915..bd7005ca6 100644 --- a/crates/hir_def/src/body/scope.rs +++ b/crates/hir_def/src/body/scope.rs | |||
@@ -188,8 +188,8 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope | |||
188 | compute_expr_scopes(*body_expr, body, scopes, scope); | 188 | compute_expr_scopes(*body_expr, body, scopes, scope); |
189 | } | 189 | } |
190 | Expr::While { condition, body: body_expr, label } => { | 190 | Expr::While { condition, body: body_expr, label } => { |
191 | compute_expr_scopes(*condition, body, scopes, scope); | ||
192 | let scope = scopes.new_labeled_scope(scope, make_label(label)); | 191 | let scope = scopes.new_labeled_scope(scope, make_label(label)); |
192 | compute_expr_scopes(*condition, body, scopes, scope); | ||
193 | compute_expr_scopes(*body_expr, body, scopes, scope); | 193 | compute_expr_scopes(*body_expr, body, scopes, scope); |
194 | } | 194 | } |
195 | Expr::Loop { body: body_expr, label } => { | 195 | Expr::Loop { body: body_expr, label } => { |