Skip to content

Commit e051ae8

Browse files
bors[bot]xffxff
andauthored
Merge #10786
10786: minor: remove duplicate calls r=Veykril a=XFFXFF `scopes.set_scope(*expr, scope)` is duplicate, because we always call it in `compute_expr_scopes` https://github.com/rust-analyzer/rust-analyzer/blob/add6cccd4c923fbb5c83cc27b06aa84b2cbc9557/crates/hir_def/src/body/scope.rs#L175-L180 Co-authored-by: zhoufan <[email protected]>
2 parents add6ccc + 1f1682e commit e051ae8

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

crates/hir_def/src/body/scope.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,15 @@ fn compute_block_scopes(
151151
match stmt {
152152
Statement::Let { pat, initializer, else_branch, .. } => {
153153
if let Some(expr) = initializer {
154-
scopes.set_scope(*expr, scope);
155154
compute_expr_scopes(*expr, body, scopes, scope);
156155
}
157156
if let Some(expr) = else_branch {
158-
scopes.set_scope(*expr, scope);
159157
compute_expr_scopes(*expr, body, scopes, scope);
160158
}
161159
scope = scopes.new_scope(scope);
162160
scopes.add_bindings(body, scope, *pat);
163161
}
164162
Statement::Expr { expr, .. } => {
165-
scopes.set_scope(*expr, scope);
166163
compute_expr_scopes(*expr, body, scopes, scope);
167164
}
168165
}

0 commit comments

Comments
 (0)