Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDon't emit the same compiler diagnostic twice. #45519
Conversation
michaelwoerister
added some commits
Oct 25, 2017
rust-highfive
assigned
arielb1
Oct 25, 2017
This comment has been minimized.
This comment has been minimized.
|
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
To clarify what motivates this PR: With incremental compilation there are cases where we emit diagnostics that we have cached from the previous compilation session. It then sometimes occurs that we have to recompute a value (because we have not cached it) but cannot decide for sure if we should re-emit diagnostics during this re-computation. This PR solves the problem by having a global filter that just remembers all diagnostics that have already been emitted. |
kennytm
added
the
S-waiting-on-review
label
Oct 25, 2017
This comment has been minimized.
This comment has been minimized.
|
So this is only needed when anonymous nodes (today trait selection) can emit warnings? Trait selection is already called very unpredictably, so emitting warnings from there is a good way to spam the user. I think that every place we want to use anonymous nodes in is going to be evaluated unpredictably (because we can't come with a good set of dep-nodes that should all be evaluated) and therefore would not be a good place to emit warnings from. |
michaelwoerister
referenced this pull request
Oct 25, 2017
Merged
incr.comp.: Implement compiler diagnostic persistence. #45472
This comment has been minimized.
This comment has been minimized.
|
It also solves #34229 and makes the implementation of this deduplication logic cleaner. |
This comment has been minimized.
This comment has been minimized.
|
That's a hacky but ok way of dealing with the derive problem |
This comment has been minimized.
This comment has been minimized.
|
|
kennytm
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Oct 26, 2017
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Oct 26, 2017
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 9736474
into
rust-lang:master
Oct 26, 2017
bors
added a commit
that referenced
this pull request
Oct 30, 2017
bors
added a commit
that referenced
this pull request
Nov 1, 2017
This comment has been minimized.
This comment has been minimized.
|
Hmm, after this PR the error count is wrong. For example, the code in #34229 stops after three unique errors, but says "aborting due to 9 previous errors". |
michaelwoerister commentedOct 25, 2017
This PR makes the compiler filter out diagnostic messages that have already been emitted during the same compilation session.