From e5c656d8042afdf9601e4de1285679688c3a2b51 Mon Sep 17 00:00:00 2001 From: David Barsky Date: Wed, 23 Oct 2024 12:44:57 -0700 Subject: [PATCH] internal: log original syntax on panic --- crates/span/src/ast_id.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/span/src/ast_id.rs b/crates/span/src/ast_id.rs index 0ebd72e151..1d81d68451 100644 --- a/crates/span/src/ast_id.rs +++ b/crates/span/src/ast_id.rs @@ -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::>(), + item ), } }