diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-11-17 10:39:19 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-17 10:39:19 +0000 |
| commit | e051ae8f195c70e558a1fe6ca4d8b551735165b2 (patch) | |
| tree | 317e8a682aad75cfaa30dea30161bb14884f472e | |
| parent | add6cccd4c923fbb5c83cc27b06aa84b2cbc9557 (diff) | |
| parent | 1f1682ee1ec7c90879113022ca970b5086b6a44b (diff) | |
| download | rust-e051ae8f195c70e558a1fe6ca4d8b551735165b2.tar.gz rust-e051ae8f195c70e558a1fe6ca4d8b551735165b2.zip | |
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 <1247714429@qq.com>
| -rw-r--r-- | crates/hir_def/src/body/scope.rs | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/crates/hir_def/src/body/scope.rs b/crates/hir_def/src/body/scope.rs index f40eb2f9d41..147d6412357 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); } } |
