diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-06 14:19:58 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-06 14:19:58 +0000 |
commit | 1cc6879576b04850db3dd8aa1df0cf7c8f270503 (patch) | |
tree | 9221e6742315cc0faa8cdec5d44852afcf7d28e1 /crates/ra_hir | |
parent | 5947c1f8b52deb4fcfd97970ba6eb473f092cb94 (diff) | |
parent | 57da3df99a52ccedd7a684d2053db766e5681a61 (diff) |
Merge #3489
3489: More robust expression lowering r=matklad a=matklad
Closes #2236
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/source_analyzer.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index f3f1ed05a..331ecdd9c 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs | |||
@@ -261,7 +261,7 @@ fn scope_for_offset( | |||
261 | .scope_by_expr() | 261 | .scope_by_expr() |
262 | .iter() | 262 | .iter() |
263 | .filter_map(|(id, scope)| { | 263 | .filter_map(|(id, scope)| { |
264 | let source = source_map.expr_syntax(*id)?; | 264 | let source = source_map.expr_syntax(*id).ok()?; |
265 | // FIXME: correctly handle macro expansion | 265 | // FIXME: correctly handle macro expansion |
266 | if source.file_id != offset.file_id { | 266 | if source.file_id != offset.file_id { |
267 | return None; | 267 | return None; |
@@ -337,7 +337,7 @@ fn adjust( | |||
337 | .scope_by_expr() | 337 | .scope_by_expr() |
338 | .iter() | 338 | .iter() |
339 | .filter_map(|(id, scope)| { | 339 | .filter_map(|(id, scope)| { |
340 | let source = source_map.expr_syntax(*id)?; | 340 | let source = source_map.expr_syntax(*id).ok()?; |
341 | // FIXME: correctly handle macro expansion | 341 | // FIXME: correctly handle macro expansion |
342 | if source.file_id != file_id { | 342 | if source.file_id != file_id { |
343 | return None; | 343 | return None; |