Skip to content

Commit

Permalink
Merge pull request #18391 from davidbarsky/david/log-syntax-on-panic
Browse files Browse the repository at this point in the history
internal: log original syntax on panic
  • Loading branch information
Veykril authored Oct 23, 2024
2 parents f0f2605 + e5c656d commit 49e85de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/span/src/ast_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ impl AstIdMap {
match self.map.raw_entry().from_hash(hash, |&idx| self.arena[idx] == ptr) {
Some((&idx, &())) => ErasedFileAstId(idx.into_raw().into_u32()),
None => panic!(
"Can't find {:?} in AstIdMap:\n{:?}",
"Can't find {:?} in AstIdMap:\n{:?}\n source text: {}",
item,
self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(),
item
),
}
}
Expand Down

0 comments on commit 49e85de

Please sign in to comment.