diff options
Diffstat (limited to 'crates/ra_hir_def/src/body.rs')
-rw-r--r-- | crates/ra_hir_def/src/body.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index e60adc146..57ba45b45 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs | |||
@@ -151,7 +151,7 @@ pub struct BodySourceMap { | |||
151 | expr_map: FxHashMap<ExprSource, ExprId>, | 151 | expr_map: FxHashMap<ExprSource, ExprId>, |
152 | expr_map_back: ArenaMap<ExprId, Result<ExprSource, SyntheticSyntax>>, | 152 | expr_map_back: ArenaMap<ExprId, Result<ExprSource, SyntheticSyntax>>, |
153 | pat_map: FxHashMap<PatSource, PatId>, | 153 | pat_map: FxHashMap<PatSource, PatId>, |
154 | pat_map_back: ArenaMap<PatId, PatSource>, | 154 | pat_map_back: ArenaMap<PatId, Result<PatSource, SyntheticSyntax>>, |
155 | field_map: FxHashMap<(ExprId, usize), AstPtr<ast::RecordField>>, | 155 | field_map: FxHashMap<(ExprId, usize), AstPtr<ast::RecordField>>, |
156 | expansions: FxHashMap<InFile<AstPtr<ast::MacroCall>>, HirFileId>, | 156 | expansions: FxHashMap<InFile<AstPtr<ast::MacroCall>>, HirFileId>, |
157 | } | 157 | } |
@@ -242,7 +242,7 @@ impl BodySourceMap { | |||
242 | } | 242 | } |
243 | 243 | ||
244 | pub fn pat_syntax(&self, pat: PatId) -> Result<PatSource, SyntheticSyntax> { | 244 | pub fn pat_syntax(&self, pat: PatId) -> Result<PatSource, SyntheticSyntax> { |
245 | self.pat_map_back.get(pat).copied().ok_or(SyntheticSyntax) | 245 | self.pat_map_back[pat] |
246 | } | 246 | } |
247 | 247 | ||
248 | pub fn node_pat(&self, node: InFile<&ast::Pat>) -> Option<PatId> { | 248 | pub fn node_pat(&self, node: InFile<&ast::Pat>) -> Option<PatId> { |