mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
internal: log original syntax on panic
This commit is contained in:
parent
f0f26053ab
commit
e5c656d804
1 changed files with 2 additions and 1 deletions
|
@ -224,9 +224,10 @@ impl AstIdMap {
|
||||||
match self.map.raw_entry().from_hash(hash, |&idx| self.arena[idx] == ptr) {
|
match self.map.raw_entry().from_hash(hash, |&idx| self.arena[idx] == ptr) {
|
||||||
Some((&idx, &())) => ErasedFileAstId(idx.into_raw().into_u32()),
|
Some((&idx, &())) => ErasedFileAstId(idx.into_raw().into_u32()),
|
||||||
None => panic!(
|
None => panic!(
|
||||||
"Can't find {:?} in AstIdMap:\n{:?}",
|
"Can't find {:?} in AstIdMap:\n{:?}\n source text: {}",
|
||||||
item,
|
item,
|
||||||
self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(),
|
self.arena.iter().map(|(_id, i)| i).collect::<Vec<_>>(),
|
||||||
|
item
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue