-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
WTF Error Message with `impl<T> Deref for T #28981
Comments
The error messages are correct. The existence of It might be possible to improve the error message to suggest removing the type parameter from the impl when a type parameter shadows a type that is in scope. Similar to #27218. |
It would be useful if the It should also probably abort after like 5 conflicts for the same impl and just print |
Yeah, I wasn't claim the error message was incorrect. Sorry about that. I was more claiming that the error message is unwieldy. |
This makes the error message in #28981 a bit shorter (152 to 115 lines). Previous output (the local impl was always printed twice when it conflicted with an external impl): ``` test.rs:3:1: 3:23 error: conflicting implementations for trait `core::ops::Deref` [E0119] test.rs:3 impl<T> Deref for T {} ^~~~~~~~~~~~~~~~~~~~~~ test.rs:3:1: 3:23 help: run `rustc --explain E0119` to see a detailed explanation test.rs:3:1: 3:23 note: conflicting implementation in crate `std` test.rs:3 impl<T> Deref for T {} ^~~~~~~~~~~~~~~~~~~~~~ ``` Output after this patch: ``` test.rs:3:1: 3:23 error: conflicting implementations for trait `core::ops::Deref` [E0119] test.rs:3 impl<T> Deref for T {} ^~~~~~~~~~~~~~~~~~~~~~ test.rs:3:1: 3:23 help: run `rustc --explain E0119` to see a detailed explanation note: conflicting implementation in crate `std` ```
The "type parameter aliases type" part of this issue is #24354. |
Today's error message is much shorter, and a little more helpful. We explicitly call out
|
The lack of the repeating error counts as a fix for this issue. Marking as closed. @Mark-Simulacrum, open another issue for that if you feel it deserves it. |
Play link: http://is.gd/WYlDGu
Error message:
The text was updated successfully, but these errors were encountered: