diff options
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 69144e94f..b0063cad2 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -5,7 +5,7 @@ use rustc_hash::FxHashMap; | |||
5 | 5 | ||
6 | use ra_arena::{Arena, RawId, impl_arena_id, map::ArenaMap}; | 6 | use ra_arena::{Arena, RawId, impl_arena_id, map::ArenaMap}; |
7 | use ra_db::{LocalSyntaxPtr, Cancelable}; | 7 | use ra_db::{LocalSyntaxPtr, Cancelable}; |
8 | use ra_syntax::{SyntaxNodeRef, ast::{self, AstNode, LoopBodyOwner, ArgListOwner, NameOwner}}; | 8 | use ra_syntax::ast::{self, AstNode, LoopBodyOwner, ArgListOwner, NameOwner}; |
9 | 9 | ||
10 | use crate::{Path, type_ref::{Mutability, TypeRef}, Name, HirDatabase, DefId, Def, name::AsName}; | 10 | use crate::{Path, type_ref::{Mutability, TypeRef}, Name, HirDatabase, DefId, Def, name::AsName}; |
11 | 11 | ||
@@ -77,9 +77,9 @@ impl BodySyntaxMapping { | |||
77 | pub fn syntax_expr(&self, ptr: LocalSyntaxPtr) -> Option<ExprId> { | 77 | pub fn syntax_expr(&self, ptr: LocalSyntaxPtr) -> Option<ExprId> { |
78 | self.expr_syntax_mapping.get(&ptr).cloned() | 78 | self.expr_syntax_mapping.get(&ptr).cloned() |
79 | } | 79 | } |
80 | pub fn node_expr(&self, node: SyntaxNodeRef) -> Option<ExprId> { | 80 | pub fn node_expr(&self, node: ast::Expr) -> Option<ExprId> { |
81 | self.expr_syntax_mapping | 81 | self.expr_syntax_mapping |
82 | .get(&LocalSyntaxPtr::new(node)) | 82 | .get(&LocalSyntaxPtr::new(node.syntax())) |
83 | .cloned() | 83 | .cloned() |
84 | } | 84 | } |
85 | pub fn pat_syntax(&self, pat: PatId) -> Option<LocalSyntaxPtr> { | 85 | pub fn pat_syntax(&self, pat: PatId) -> Option<LocalSyntaxPtr> { |
@@ -88,9 +88,9 @@ impl BodySyntaxMapping { | |||
88 | pub fn syntax_pat(&self, ptr: LocalSyntaxPtr) -> Option<PatId> { | 88 | pub fn syntax_pat(&self, ptr: LocalSyntaxPtr) -> Option<PatId> { |
89 | self.pat_syntax_mapping.get(&ptr).cloned() | 89 | self.pat_syntax_mapping.get(&ptr).cloned() |
90 | } | 90 | } |
91 | pub fn node_pat(&self, node: SyntaxNodeRef) -> Option<PatId> { | 91 | pub fn node_pat(&self, node: ast::Pat) -> Option<PatId> { |
92 | self.pat_syntax_mapping | 92 | self.pat_syntax_mapping |
93 | .get(&LocalSyntaxPtr::new(node)) | 93 | .get(&LocalSyntaxPtr::new(node.syntax())) |
94 | .cloned() | 94 | .cloned() |
95 | } | 95 | } |
96 | 96 | ||