diff options
author | Aleksey Kladov <[email protected]> | 2018-12-18 11:58:54 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-18 11:58:54 +0000 |
commit | d05790b9478705c47c9de34bfdee08f823e4e92f (patch) | |
tree | 97d5affb3c252c7f84ac00a7a38195dbdbce566b /crates/ra_hir/src | |
parent | f3ea21ac16481de1197c9daadee3be96546974b5 (diff) |
Work around a bug
cc #288
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/lib.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 760524f6b..80354a49d 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs | |||
@@ -143,11 +143,14 @@ impl SourceFileItems { | |||
143 | return id; | 143 | return id; |
144 | } | 144 | } |
145 | // This should not happen. Let's try to give a sensible diagnostics. | 145 | // This should not happen. Let's try to give a sensible diagnostics. |
146 | if let Some((_, i)) = self.arena.iter().find(|(_id, i)| i.range() == item.range()) { | 146 | if let Some((id, i)) = self.arena.iter().find(|(_id, i)| i.range() == item.range()) { |
147 | panic!( | 147 | // FIXME(#288): whyyy are we getting here? |
148 | log::error!( | ||
148 | "unequal syntax nodes with the same range:\n{:?}\n{:?}", | 149 | "unequal syntax nodes with the same range:\n{:?}\n{:?}", |
149 | item, i | 150 | item, |
150 | ) | 151 | i |
152 | ); | ||
153 | return id; | ||
151 | } | 154 | } |
152 | panic!( | 155 | panic!( |
153 | "Can't find {:?} in SourceFileItems:\n{:?}", | 156 | "Can't find {:?} in SourceFileItems:\n{:?}", |