Skip to content

Commit 4d541f7

Browse files
committed
internal: log original syntax on panic
1 parent 6f8e75a commit 4d541f7

File tree

1 file changed

+2
-1
lines changed
  • src/tools/rust-analyzer/crates/span/src

1 file changed

+2
-1
lines changed

src/tools/rust-analyzer/crates/span/src/ast_id.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,10 @@ impl AstIdMap {
224224
match self.map.raw_entry().from_hash(hash, |&idx| self.arena[idx] == ptr) {
225225
Some((&idx, &())) => ErasedFileAstId(idx.into_raw().into_u32()),
226226
None => panic!(
227-
"Can't find {:?} in AstIdMap:\n{:?}",
227+
"Can't find {:?} in AstIdMap:\n{:?}\n source text: {}",
228228
item,
229229
self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(),
230+
item
230231
),
231232
}
232233
}

0 commit comments

Comments
 (0)