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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user