Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/expr_store/scope.rs')
| -rw-r--r-- | crates/hir-def/src/expr_store/scope.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir-def/src/expr_store/scope.rs b/crates/hir-def/src/expr_store/scope.rs index 40ae0b7de4..c6ba0241b7 100644 --- a/crates/hir-def/src/expr_store/scope.rs +++ b/crates/hir-def/src/expr_store/scope.rs @@ -324,7 +324,7 @@ fn compute_expr_scopes( let mut scope = scopes.root_scope(); compute_expr_scopes(scopes, *id, &mut scope); } - Expr::Unsafe { id, statements, tail } | Expr::Async { id, statements, tail } => { + Expr::Unsafe { id, statements, tail } => { let mut scope = scopes.new_block_scope(*scope, *id, None); // Overwrite the old scope for the block expr, so that every block scope can be found // via the block itself (important for blocks that only contain items, no expressions). @@ -371,7 +371,6 @@ fn compute_expr_scopes( #[cfg(test)] mod tests { - use base_db::RootQueryDb; use hir_expand::{InFile, name::AsName}; use span::FileId; use syntax::{AstNode, algo::find_node_at_offset, ast}; @@ -414,7 +413,7 @@ mod tests { let (file_id, _) = editioned_file_id.unpack(&db); - let file_syntax = db.parse(editioned_file_id).syntax_node(); + let file_syntax = editioned_file_id.parse(&db).syntax_node(); let marker: ast::PathExpr = find_node_at_offset(&file_syntax, offset).unwrap(); let function = find_function(&db, file_id); @@ -570,7 +569,7 @@ fn foo() { let (file_id, _) = editioned_file_id.unpack(&db); - let file = db.parse(editioned_file_id).ok().unwrap(); + let file = editioned_file_id.parse(&db).ok().unwrap(); let expected_name = find_node_at_offset::<ast::Name>(file.syntax(), expected_offset.into()) .expect("failed to find a name at the target offset"); let name_ref: ast::NameRef = find_node_at_offset(file.syntax(), offset).unwrap(); |