-
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
Confusing error message associated with universe transition: "one type is more general than the other" #57362
Comments
Neither message seems very good, but yeah the new one isn't working as intended. Assigning to myself since this is a diagnostic regression caused by my PR. |
OK so I spent some time investigating this, but I failed to leave some notes. Here goes. First off, I believe the relevant part of this error is generated by the rust/src/librustc/infer/error_reporting/mod.rs Lines 920 to 927 in 14ea6e5
In this case, the
we will wind up with Part of the problem here is that the "to-string" for a trait-reference excludes the Finally I think we wind up invoking I think we want a message more like (not great, but similar to what we had before):
To get that, we probably need to remember what kind of thing was being compared in |
@lqd and I have been digging into this. We've made some changes so that this message at least goes through the new specific "placeholder error" mechanism, but it is still rather confusing:
So we are now working on improving the placeholder error message. The goal is something like this:
|
seems to me like even just this change would accomplish your goal:
Update: That wasn't really fair of me, since clearly part of your goal is to make explicit the elided lifetime in Another way for me to phrase that worry: the word "specific" might lead someone away from the point that an
|
The unclear diagnostic has leaked into beta. As a matter of process, I'm going to label this as a stable-to-beta regression and I'm going to beta-nominate PR #742563 so we can debate whether to backport it. (I suppose process also dictates that I reopen this bug, but I feel like our process for keeping beta-regression bugs open is pretty haphazard at the moment.) |
Prior to #56105, the error message was:
i.e. the trait is implemented only for
for<'a> fn(&'a u8)
and not for a concretefn(&'x u8)
.The new error message is:
I don't know what this message is trying to say.
Mentioning @nikomatsakis and @scalexm who worked on universes.
The text was updated successfully, but these errors were encountered: