-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve pretty-printing of HirIdValidator
errors
#107515
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Before:
After:
|
Is the "before" example in #107515 (comment) correct? It too shows the code snippet—indeed it looks like it contains the same information as in the "after" example (albeit with the duplication you mention), except in the latter the layout/order has become a little more difficult for my brain to parse? |
The code snippet was there before, though the format was rather |
Printing the HirIds first as before looks way more readable to me since they are aligned. I think we should delete the trailing HirId instead. |
8acacb8
to
58b3cbf
Compare
I completely changed the This means that all the output (I only found Let me try to capture another example later, as I already fixed the case where I was running into this. |
Now looks like this:
|
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)".
58b3cbf
to
3a75f10
Compare
Cool, given that this is internal-only, I'm happy with merging this now. I'll approve once CI is green. |
@bors r+ rollup |
…errors 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` also includes that.
…errors 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` also includes that.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#106919 (Recover `_` as `..` in field pattern) - rust-lang#107493 (Improve diagnostic for missing space in range pattern) - rust-lang#107515 (Improve pretty-printing of `HirIdValidator` errors) - rust-lang#107524 (Remove both StorageLive and StorageDead in CopyProp.) - rust-lang#107532 (Erase regions before doing uninhabited check in borrowck) - rust-lang#107559 (Rename `rust_2015` → `is_rust_2015`) - rust-lang#107577 (Reinstate the `hir-stats.rs` tests on stage 1.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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 ofHirId
, asnode_to_string
also includes that.