X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=crates%2Fhir_def%2Fsrc%2Fbody%2Fscope.rs;h=2658eece8e85e60fa93a8d95dbd4cd9bcb7a3bb4;hb=9c6542f2097df1cfcc9491036ec607c6a2842070;hp=f40eb2f9d41e38e8710e417637e2b30557cf73ee;hpb=10782bbb39485d0c0f42ff80d72233a42c4c67bb;p=rust.git diff --git a/crates/hir_def/src/body/scope.rs b/crates/hir_def/src/body/scope.rs index f40eb2f9d41..2658eece8e8 100644 --- a/crates/hir_def/src/body/scope.rs +++ b/crates/hir_def/src/body/scope.rs @@ -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 {