Skip to content

Commit a7ea9c0

Browse files
authored
Merge pull request #18391 from davidbarsky/david/log-syntax-on-panic
internal: log original syntax on panic
2 parents 6f8e75a + 4d541f7 commit a7ea9c0

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)