Uh oh!
There was an error while loading. Please reload this page.
Centralize and clean type error reporting - #34907
Conversation
arielb1
commented
Jul 18, 2016
Few more errors to modernize: Will fix these tomorrow. |
All type errors now look like: |
There was a problem hiding this comment.
it's hard for me to tell from this diff: has the "values differ in mutability" part of the message been entirely removed?
There was a problem hiding this comment.
See the error message above ^. It is now a label in new-skool and a single note in old-skool.
nikomatsakis
commented
Jul 19, 2016
So I'm 👍 on removing the hack around newlines and centralizing the error reporting infrastructure here to go through a more common set of methods. That said, it seems like the new messages may be less specific and quite possibly less helpful than the old ones. It might be though that if we combined this patch with something that gives intelligent diffs, that would be the best of both worlds. Basically I think we want to avoid presenting people with two types and having them find the difference: so if we used to point out that the problem has to do with mutability, but now we make you figure it out for yourself, that could be a regression in usability. I also think that we calling everything "mismatched types" might be confused for people, if we can give a more specific indicator of where the type problem is. Also, @arielb1, you mention this:
How does it look now? Can you give an example of what got uglier? |
a44b5bf to
7966739Compareready for review. I would like @nikomatsakis to look at the last commit (efe1a68). |
32fd204 to
5b2cf69CompareUnfortunately, projection errors do not come with a nice set of mismatched types. This is because the type equality check occurs within a higher-ranked context. Therefore, only the type error is reported. This is ugly but was always the situation. I will introduce better errors for the lower-ranked case in another commit. Fixes the last known occurence of rust-lang#31173
Refactor constant evaluation to use a single error reporting function that reports a type-error-like message. Also, unify all error codes with the "constant evaluation error" message to just E0080, and similarly for a few other duplicate codes. The old situation was a total mess, and now that we have *something* we can further iterate on the UX.
The type equation in projection takes place under a binder and a snapshot, which we can't easily take types out of. Instead, when encountering a projection error, try to re-do the projection and find the type error then. This fails to produce a sane type error when the failure was a "leak_check" failure. I can't think of a sane way to show *these*, so I just left them use the old crappy representation, and added a test to make sure we don't break them.
arielb1
commented
Jul 24, 2016
@bors r=nikomatsakis |
bors
commented
Jul 24, 2016
📌 Commit 717e392 has been approved by |
arielb1
commented
Jul 24, 2016
@bors retry |
arielb1
commented
Jul 24, 2016
@bors r- |
arielb1
commented
Jul 24, 2016
@bors retry r=nikomatsakis |
bors
commented
Jul 24, 2016
📌 Commit 717e392 has been approved by |
bors
commented
Jul 25, 2016
⌛ Testing commit 717e392 with merge d398d9c... |
bors
commented
Jul 25, 2016
💔 Test failed - auto-linux-cross-opt |
alexcrichton
commented
Jul 25, 2016
@bors: retry weeps On Sun, Jul 24, 2016 at 10:08 PM, bors notifications@github.com wrote:
|
bors
commented
Jul 25, 2016
⌛ Testing commit 717e392 with merge eccf954... |
bors
commented
Jul 25, 2016
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
alexcrichton
commented
Jul 25, 2016
@bors: retry On Sun, Jul 24, 2016 at 10:43 PM, bors notifications@github.com wrote:
|
alexcrichton
commented
Jul 25, 2016
@bors: retry |
bors
commented
Jul 25, 2016
⌛ Testing commit 717e392 with merge 084ebe7... |
bors
commented
Jul 25, 2016
💔 Test failed - auto-win-gnu-32-opt |
alexcrichton
commented
Jul 25, 2016
@bors: retry On Mon, Jul 25, 2016 at 2:55 PM, bors notifications@github.com wrote:
|
bors
commented
Jul 26, 2016
⌛ Testing commit 717e392 with merge 727c4dc... |
bors
commented
Jul 26, 2016
💔 Test failed - auto-win-msvc-64-opt |
alexcrichton
commented
Jul 26, 2016
@bors: retry On Tue, Jul 26, 2016 at 3:13 AM, bors notifications@github.com wrote:
|
bors
commented
Jul 27, 2016
Centralize and clean type error reporting Refactors the code that handles type errors to be cleaner and fixes various edge cases. This made the already-bad "type mismatch resolving" error message somewhat uglier. I want to fix that in another commit before this PR is merged. Fixes#31173 r? @jonathandturner, cc @nikomatsakis
Refactors the code that handles type errors to be cleaner and fixes various edge cases.
This made the already-bad "type mismatch resolving" error message somewhat uglier. I want to fix that in another commit before this PR is merged.
Fixes#31173
r? @jonathandturner, cc @nikomatsakis