-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Improve E0599 for missing trait bounds (where clauses) #61661
Comments
Would the following be enough of an improvement?
|
This is a great improvement! In this context, the latter three lines are somewhat confusing:
Since they actually don't apply for this case. Also, it might help to elaborate the lines before that, maybe an explicit mention of |
What do you think of the following output?
I'll look into removing the last few lines as I agree that they are somewhat misleading here and obscure the solution, but we have to make sure we don't actually hide information useful for other cases with different underlying problems. |
Yeah, this would be even better. I still think it would be nice to specifically call out |
What about this?
|
I find the four separate span blocks a bit distracting. I would opt for something like this:
On the other hand, a span block pointing to the |
The current output in the PR looks like this
I'm a bit hesitant about removing spans at this point. It might be true that changing it to the following could be a good idea, but I'm not sure:
|
Let's see if we can get some wisdom from the crowd. |
Add more context to E0599 errors Point at the intermediary unfulfilled trait bounds. Fix rust-lang#52523, fix rust-lang#61661, cc rust-lang#36513, fix rust-lang#68131, fix rust-lang#64417, fix rust-lang#61768, cc rust-lang#57457, cc rust-lang#9082, fix rust-lang#57994, cc rust-lang#64934, cc rust-lang#65149.
Add more context to E0599 errors Point at the intermediary unfulfilled trait bounds. Fix rust-lang#52523, fix rust-lang#61661, cc rust-lang#36513, fix rust-lang#68131, fix rust-lang#64417, fix rust-lang#61768, cc rust-lang#57457, cc rust-lang#9082, fix rust-lang#57994, cc rust-lang#64934, cc rust-lang#65149.
For the following example:
The error message is:
Foo<T>
does actually implementBar
, and this makes the suggestions from the compiler misleading in this case: there is already an implementation forFoo<T> : Bar
, andBar
is already in scope. It would be much more helpful if the compiler could suggest the trait bounds necessary to satisfy the requirement.This seems very similar to what @estebank suggested in #9082 (comment).
The text was updated successfully, but these errors were encountered: