diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-11 09:13:53 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-11 09:13:53 +0100 |
commit | e6e2571bdf780d304c792d4317bbaf1d6f5d7a0a (patch) | |
tree | 0ee7a9b388da1581a1b66c46cd89fcefcd2288c1 /crates/ra_hir | |
parent | 6d9acb875306fb8a032ec12285df48d3d60929fe (diff) | |
parent | 6a8b3c1d4ba992630d4382feed18d3b12b43f7d1 (diff) |
Merge #1133
1133: fix typo r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 12 |
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 { | |||
51 | pub struct BodySourceMap { | 51 | pub 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 | ||
59 | type PatPrr = Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>>; | 59 | type PatPtr = Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>>; |
60 | 60 | ||
61 | impl Body { | 61 | impl 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); |