diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-10 23:29:04 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-10 23:29:04 +0100 |
commit | beb755caa2b1d7265da7d3367af3b49039dfe00e (patch) | |
tree | c7f96c8f170c43d4a65451e089783ba6550ca020 /crates/ra_hir_def/src/body.rs | |
parent | ca9a5dd1654cc0d54ed5b2bb71ec8ed559470276 (diff) | |
parent | c1244c853c6bdc42bf91a77768963c0d287093ff (diff) |
Merge #3937
3937: Forward compat r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/body.rs')
-rw-r--r-- | crates/ra_hir_def/src/body.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 5f9d53ecb..e09996c6f 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs | |||
@@ -236,7 +236,7 @@ impl Index<PatId> for Body { | |||
236 | 236 | ||
237 | impl BodySourceMap { | 237 | impl BodySourceMap { |
238 | pub fn expr_syntax(&self, expr: ExprId) -> Result<ExprSource, SyntheticSyntax> { | 238 | pub fn expr_syntax(&self, expr: ExprId) -> Result<ExprSource, SyntheticSyntax> { |
239 | self.expr_map_back[expr] | 239 | self.expr_map_back[expr].clone() |
240 | } | 240 | } |
241 | 241 | ||
242 | pub fn node_expr(&self, node: InFile<&ast::Expr>) -> Option<ExprId> { | 242 | pub fn node_expr(&self, node: InFile<&ast::Expr>) -> Option<ExprId> { |
@@ -255,7 +255,7 @@ impl BodySourceMap { | |||
255 | } | 255 | } |
256 | 256 | ||
257 | pub fn pat_syntax(&self, pat: PatId) -> Result<PatSource, SyntheticSyntax> { | 257 | pub fn pat_syntax(&self, pat: PatId) -> Result<PatSource, SyntheticSyntax> { |
258 | self.pat_map_back[pat] | 258 | self.pat_map_back[pat].clone() |
259 | } | 259 | } |
260 | 260 | ||
261 | pub fn node_pat(&self, node: InFile<&ast::Pat>) -> Option<PatId> { | 261 | pub fn node_pat(&self, node: InFile<&ast::Pat>) -> Option<PatId> { |
@@ -264,6 +264,6 @@ impl BodySourceMap { | |||
264 | } | 264 | } |
265 | 265 | ||
266 | pub fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::RecordField> { | 266 | pub fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::RecordField> { |
267 | self.field_map[&(expr, field)] | 267 | self.field_map[&(expr, field)].clone() |
268 | } | 268 | } |
269 | } | 269 | } |