From 64957acb5f359763395a54e314d1f5d5cfc6ccf3 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 21 Mar 2021 01:10:59 +0100 Subject: Fix incorrect scoping in while expressions --- crates/hir_def/src/body/scope.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir_def/src/body') 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 compute_expr_scopes(*body_expr, body, scopes, scope); } Expr::While { condition, body: body_expr, label } => { - compute_expr_scopes(*condition, body, scopes, scope); let scope = scopes.new_labeled_scope(scope, make_label(label)); + compute_expr_scopes(*condition, body, scopes, scope); compute_expr_scopes(*body_expr, body, scopes, scope); } Expr::Loop { body: body_expr, label } => { -- cgit v1.2.3