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` add6cccd4c/crates/hir_def/src/body/scope.rs (L175-L180)
Co-authored-by: zhoufan <1247714429@qq.com>
This commit is contained in:
commit
e051ae8f19
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user