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:
parent
3b639486c1
commit
3a75f10af1
7 changed files with 32 additions and 49 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue