-
Notifications
You must be signed in to change notification settings - Fork 13.5k
compiletest: Improve diagnostics for line annotation mismatches #140622
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
Conversation
Some changes occurred in src/tools/compiletest cc @jieyouxu |
Nice! I'll play around with this |
This comment was marked as resolved.
This comment was marked as resolved.
@jieyouxu I does two things
Also, this part is not always added, it's only added to primary diagnostics, but not to labels or suggestions, for example. I think maybe just drop it to reduce noise and duplication. |
Another possible improvement is to display relative paths to test files instead of absolute paths, also to avoid noise, duplication and rightward shift. The main requirement for the paths is to be "clickable", so you can quickly go from a Relative paths here would work for me (vscode + |
Sorry for the wait, I played around with this locally, and I think it's an improvement. I have some feedback:
Misc design feedbackFor the actual messages, I might even do sth like:
If possible, we should report both the one we got and the one we expect (kind, message, line number). Questions
|
Let me know what u think. |
Reminder, once the PR becomes ready for a review, use |
Yeah, that's from an entirely different part of compiletest, not from expected error checking.
What do you suggest reporting instead?
I'll try something like this.
I didn't change any normalization rules. |
I mean the relative-from-check-root path, i.e. Agreed that the clickable part is really important, because I use that too :D Also |
Re. what I said about
I was thinking we only report that path once, i.e. after the "Blessing...` lines. However, now that I think about it some more, that can be easy to miss esp. if there's a ton of mismatches. So I was thinking maybe sth like what I suggested re.
strikes a reasonable balance between repeating the file too many times (noisy) vs easy to miss / click. I'm ofc open to alternative formats, I can't really think of a better one in this moment. |
…mpiler-errors Fix a compiletest blessing message It was showing compare mode instead of test name. Fixes rust-lang#140945. Noticed in rust-lang#140622 (comment).
…compiler-errors Fix a compiletest blessing message It was showing compare mode instead of test name. Fixes rust-lang#140945. Noticed in rust-lang#140622 (comment).
…compiler-errors Fix a compiletest blessing message It was showing compare mode instead of test name. Fixes rust-lang#140945. Noticed in rust-lang#140622 (comment).
Rollup merge of rust-lang#140953 - jieyouxu:compiletest-bless-msg, r=compiler-errors Fix a compiletest blessing message It was showing compare mode instead of test name. Fixes rust-lang#140945. Noticed in rust-lang#140622 (comment).
…errors Fix a compiletest blessing message It was showing compare mode instead of test name. Fixes #140945. Noticed in rust-lang/rust#140622 (comment).
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Updated the PR, although I still need to cleanup the code. I've applied all the suggestions from the thread, but compressed the output from #140622 (comment) to eat less vertical space (more vertical space is inconvenient when there are many failing tests). |
This comment has been minimized.
This comment has been minimized.
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
Some changes occurred in tests/ui/sanitizer cc @rcvalle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I played around with this locally, and I think this is definitely better than what we had.
@bors r+ rollup |
compiletest: Improve diagnostics for line annotation mismatches When some line annotations are missing or misplaced, compiletest reports an error, but the error is not very convenient. This PR attempts to improve the user experience. - The "expected ... not found" messages are no longer duplicated. - The `proc_res.status` and `proc_res.cmdline` message is no longer put in the middle of other messages describing the annotation mismatches, it's now put into the end. - Compiletest now makes suggestions if there are fuzzy matches between expected and actually reported errors (e.g. the annotation is put on a wrong line). - Missing diagnostic kinds are no longer produce an error eagerly, but instead treated as always mismatching kinds, so they can produce suggestions telling the right kind. I'll post screenshots in the thread below, but the behavior shown on the screenshots can be reproduced locally using the new test `tests/ui/compiletest-self-test/line-annotation-mismatches.rs`. This also fixes rust-lang#140940. r? `@jieyouxu`
Rollup of 8 pull requests Successful merges: - #140622 (compiletest: Improve diagnostics for line annotation mismatches) - #142641 (Generate symbols.o for proc-macros too) - #142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system) - #142742 ([win][aarch64] Fix linking statics on Arm64EC, take 2) - #142894 (phantom_variance_markers: fix identifier usage in macro) - #142928 (Fix hang in --print=file-names in bootstrap) - #142930 (Account for beta revisions when normalizing versions) - #142932 (rustdoc-json: Keep empty generic args if parenthesized) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - #140005 (Set MSG_NOSIGNAL for UnixStream) - #140622 (compiletest: Improve diagnostics for line annotation mismatches) - #142354 (Fixes firefox copy paste issue) - #142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system) - #142779 (Add note about `str::split` handling of no matches.) - #142894 (phantom_variance_markers: fix identifier usage in macro) - #142928 (Fix hang in --print=file-names in bootstrap) - #142932 (rustdoc-json: Keep empty generic args if parenthesized) - #142933 (Simplify root goal API of solver a bit) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #140622 - petrochenkov:annusexp, r=jieyouxu compiletest: Improve diagnostics for line annotation mismatches When some line annotations are missing or misplaced, compiletest reports an error, but the error is not very convenient. This PR attempts to improve the user experience. - The "expected ... not found" messages are no longer duplicated. - The `proc_res.status` and `proc_res.cmdline` message is no longer put in the middle of other messages describing the annotation mismatches, it's now put into the end. - Compiletest now makes suggestions if there are fuzzy matches between expected and actually reported errors (e.g. the annotation is put on a wrong line). - Missing diagnostic kinds are no longer produce an error eagerly, but instead treated as always mismatching kinds, so they can produce suggestions telling the right kind. I'll post screenshots in the thread below, but the behavior shown on the screenshots can be reproduced locally using the new test `tests/ui/compiletest-self-test/line-annotation-mismatches.rs`. This also fixes #140940. r? ``@jieyouxu``
When some line annotations are missing or misplaced, compiletest reports an error, but the error is not very convenient.
This PR attempts to improve the user experience.
proc_res.status
andproc_res.cmdline
message is no longer put in the middle of other messages describing the annotation mismatches, it's now put into the end.I'll post screenshots in the thread below, but the behavior shown on the screenshots can be reproduced locally using the new test
tests/ui/compiletest-self-test/line-annotation-mismatches.rs
.This also fixes #140940.
r? @jieyouxu