Open
Description
Code
trait MyTrait {}
struct S;
impl <U> MyTrait for S {}
Current output
error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
--> src/lib.rs:5:7
|
5 | impl <U> MyTrait for S {}
| ^ unconstrained type parameter
For more information about this error, try `rustc --explain E0207`.
error: could not compile `playground` due to previous error
Desired output
error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
--> src/lib.rs:5:7
|
5 | impl <U> MyTrait for S {}
| ^ unconstrained type parameter
Either remove the type parameter (<U>) or make use of it, for example ` for S<U>`.
For more information about this error, try `rustc --explain E0207`.
error: could not compile `playground` due to previous error
Rationale and extra context
If we have an unconstrained type parameter, we get an error stating that it is unconstrained, but no suggestions on what to do about it and force the user to google.
Is there room to reduce the learning curve here with better diagnostics?
Other cases
No response
Anything else?
No response