aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/expr.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index a2840c15d..a8e115e47 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -51,12 +51,12 @@ pub struct Body {
51pub struct BodySourceMap { 51pub struct BodySourceMap {
52 expr_map: FxHashMap<SyntaxNodePtr, ExprId>, 52 expr_map: FxHashMap<SyntaxNodePtr, ExprId>,
53 expr_map_back: ArenaMap<ExprId, SyntaxNodePtr>, 53 expr_map_back: ArenaMap<ExprId, SyntaxNodePtr>,
54 pat_map: FxHashMap<PatPrr, PatId>, 54 pat_map: FxHashMap<PatPtr, PatId>,
55 pat_map_back: ArenaMap<PatId, PatPrr>, 55 pat_map_back: ArenaMap<PatId, PatPtr>,
56 field_map: FxHashMap<(ExprId, usize), AstPtr<ast::NamedField>>, 56 field_map: FxHashMap<(ExprId, usize), AstPtr<ast::NamedField>>,
57} 57}
58 58
59type PatPrr = Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>>; 59type PatPtr = Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>>;
60 60
61impl Body { 61impl Body {
62 pub fn params(&self) -> &[PatId] { 62 pub fn params(&self) -> &[PatId] {
@@ -129,11 +129,11 @@ impl BodySourceMap {
129 self.expr_map.get(&SyntaxNodePtr::new(node.syntax())).cloned() 129 self.expr_map.get(&SyntaxNodePtr::new(node.syntax())).cloned()
130 } 130 }
131 131
132 pub fn pat_syntax(&self, pat: PatId) -> Option<PatPrr> { 132 pub fn pat_syntax(&self, pat: PatId) -> Option<PatPtr> {
133 self.pat_map_back.get(pat).cloned() 133 self.pat_map_back.get(pat).cloned()
134 } 134 }
135 135
136 pub fn syntax_pat(&self, ptr: PatPrr) -> Option<PatId> { 136 pub fn syntax_pat(&self, ptr: PatPtr) -> Option<PatId> {
137 self.pat_map.get(&ptr).cloned() 137 self.pat_map.get(&ptr).cloned()
138 } 138 }
139 139
@@ -506,7 +506,7 @@ impl ExprCollector {
506 id 506 id
507 } 507 }
508 508
509 fn alloc_pat(&mut self, pat: Pat, ptr: PatPrr) -> PatId { 509 fn alloc_pat(&mut self, pat: Pat, ptr: PatPtr) -> PatId {
510 let id = self.pats.alloc(pat); 510 let id = self.pats.alloc(pat);
511 self.source_map.pat_map.insert(ptr, id); 511 self.source_map.pat_map.insert(ptr, id);
512 self.source_map.pat_map_back.insert(id, ptr); 512 self.source_map.pat_map_back.insert(id, ptr);