Skip to content

Commit 49e85de

Browse files
authored
Merge pull request #18391 from davidbarsky/david/log-syntax-on-panic
internal: log original syntax on panic
2 parents f0f2605 + e5c656d commit 49e85de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)