]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_def/src/body/scope.rs
parameters.split_last()
[rust.git] / crates / hir_def / src / body / scope.rs
index f40eb2f9d41e38e8710e417637e2b30557cf73ee..2658eece8e85e60fa93a8d95dbd4cd9bcb7a3bb4 100644 (file)
@@ -151,18 +151,15 @@ fn compute_block_scopes(
         match stmt {
             Statement::Let { pat, initializer, else_branch, .. } => {
                 if let Some(expr) = initializer {
-                    scopes.set_scope(*expr, scope);
                     compute_expr_scopes(*expr, body, scopes, scope);
                 }
                 if let Some(expr) = else_branch {
-                    scopes.set_scope(*expr, scope);
                     compute_expr_scopes(*expr, body, scopes, scope);
                 }
                 scope = scopes.new_scope(scope);
                 scopes.add_bindings(body, scope, *pat);
             }
             Statement::Expr { expr, .. } => {
-                scopes.set_scope(*expr, scope);
                 compute_expr_scopes(*expr, body, scopes, scope);
             }
         }
@@ -207,7 +204,7 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope
         }
         Expr::Match { expr, arms } => {
             compute_expr_scopes(*expr, body, scopes, scope);
-            for arm in arms {
+            for arm in arms.iter() {
                 let mut scope = scopes.new_scope(scope);
                 scopes.add_bindings(body, scope, arm.pat);
                 match arm.guard {