-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Put back ui json check #48684
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
Put back ui json check #48684
Conversation
src/tools/compiletest/src/runtest.rs
Outdated
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.
-Zui-testing was lost during revert.
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.
It doesn't work at all. Whatever I try to do, I always end with empty stderr so I'll keep my code for the moment.
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.
Ah nevermind, I didn't update correctly...
@GuillaumeGomez I think I got the restoration of |
src/librustc_errors/emitter.rs
Outdated
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.
While this does successfully implement #48041, it seems rather ad hoc to make a show_explain method be part of the contract of the Emitter trait. (In contrast to how it makes sense for all Emitters to have an emit method, because that's what being an Emitter is all about.) Can we implement this in a more generalizable way?
Two potential alternatives that come to mind:
- Make the
Emittertrait have adestinationmethod that exposes something we can write arbitrary lines to, and use it to write the--explainusage message inabort_if_errors.JsonEmitter'sdstfield is of typeBox<Write + Send>, andEmitterWriter'sDestinationimplementsWriteand the field of all three of its variants implementSend(visible in the source in the case ofBufferedTerminalandRaw, and thetermdocs say thatStderrTerminalisSend), so I think the types should check out.
- Implement the
--explainmessage as aDiagnostic, adding a plainer formatting mode toDiagnosticif necessary.
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.
@GuillaumeGomez can you comment on this?
src/libsyntax/json.rs
Outdated
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.
As I mentioned in passing at the end of a previous comment, Handler already knows what what codes we've emitted; JsonEmitter shouldn't have to know this.
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.
Oh indeed. I'll remove this add.
src/librustc_errors/emitter.rs
Outdated
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.
(If we end up needing to regenerate the UI test expectations anyway in the course of this PR, then we might as well also update the language (and use backticks) at the same time; but if not, then we can continue leave those tasks to #48559.)
|
☔ The latest upstream changes (presumably #48586) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@petrochenkov: Reverting seems like way too much troubles... |
d61877f to
1975eb4
Compare
|
This new way of handling things will certainly please you more. :) |
1975eb4 to
4c5adcf
Compare
|
☔ The latest upstream changes (presumably #48125) made this pull request unmergeable. Please resolve the merge conflicts. |
7c371ad to
8a6f0a2
Compare
|
☔ The latest upstream changes (presumably #47832) made this pull request unmergeable. Please resolve the merge conflicts. |
bcf99f3 to
ef6dbb1
Compare
46dc072 to
5a48d31
Compare
|
@petrochenkov: Tests (finally) passed. |
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.
Last thing: removing this trailing empty line and the empty line after "Some errors occurred...", then we'll land this with higher priority.
5a48d31 to
c203cbb
Compare
|
@petrochenkov: Done as well, but let's wait for CI confirmation first. |
43bda9a to
6c673ef
Compare
6c673ef to
2e104a7
Compare
|
@petrochenkov: New tests are being added all the time. T_T |
|
@bors r+ p=1 |
|
📌 Commit 2e104a7 has been approved by |
…chenkov Put back ui json check r? @petrochenkov
|
☀️ Test successful - status-appveyor, status-travis |
r? @petrochenkov