-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Weird error in trait with HRTB for the same trait on Self
in a method. Also bad diagnostic with nonsensical suggestion.
#84435
Comments
This code used to compile fine in rust |
This looks similar to #84398, but that one's a recent regression. |
In
This range includes
In this list, I would suspect that #27641 could be the regression point. In
That’s a huge range with no nightly versions existing in between…
Looking through this, it might be #30389 since that’s related to RFC 1214 again. Skimming the RFC and also in general thinking about this code a few times I don’t see any reason why this shouldn’t be allowed to be accepted by the compiler. So I’ll consider this a bug. @rustbot modify labels: C-bug, A-traits, A-lifetimes, D-confusing, A-suggestion-diagnostics. The labels are quite diverse now, since this could count as 3 distinct issues:
Even though the code used to compile pre- |
Another case of this bug (https://users.rust-lang.org/t/strange-type-annotations-needed-error/74117?u=chrefr): trait Trait<'a> {}
trait Foo<'a>: Trait<'a> + for<'b> Trait<'b> {}
|
Current output:
|
Given the following code:
(playground)
The current output is:
I would’ve expected this code to compile. Even if there is a reason why it shouldn’t compile, the error message is about the most confusing/nonsensical error message I’ve ever seen. The “best” part is how it suggests adding arguments to
Sized
.The text was updated successfully, but these errors were encountered: