1
Fork 0

Improve pretty-printing of HirIdValidator errors

This now uses `node_to_string` for both missing and seen Ids, which includes
the snippet of code for which the Id was allocated.
Also removes the duplicated printing of `HirId`, as `node_to_string` includes that already.
Similarly, changes all other users of `node_to_string` that do so, and changes the output of `node_to_string`, which is now "$hirid ($what `$span` in $path)".
This commit is contained in:
Arpad Borsos 2023-01-31 12:09:54 +01:00
parent 3b639486c1
commit 3a75f10af1
No known key found for this signature in database
GPG key ID: FC7BCA77824B3298
7 changed files with 32 additions and 49 deletions

View file

@ -133,7 +133,7 @@ impl<'tcx, 'a> GeneratorData<'tcx, 'a> {
.cloned()
.unwrap_or_else(|| {
bug!(
"node_type: no type for node `{}`",
"node_type: no type for node {}",
ty::tls::with(|tcx| tcx
.hir()
.node_to_string(await_expr.hir_id))