-
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
Negative trait impls show as "found implementations" in error messages #79458
Comments
@rustbot claim |
While |
Actually,
|
Updating on this: I think that ignoring negative polarity implementations would be the best solution right now (especially as I'm still a new-ish contributor). In the future, it may be helpful to implement something like you suggested, but that would require a lot more changes to the compiler than is feasible for me to do right now. |
I'm going to make some cleanups to my changes, then I'll draft a PR. |
@ThePuzzlemaker Splitting it into two changes sounds good to me. Not showing the incorrect one is definitely the higher priority change. |
Turns out some of those test failures actually were correct (as when this bug was introduced, someone must have run |
(Spotted in https://users.rust-lang.org/t/the-trait-clone-is-not-implemented-for-mut-t/51989?u=scottmcm)
I tried this code https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=6862c5bd66f1fcdf55fd725a93baffcd:
Which of course fails to compile, but it gives the following confusing help:
The library now has
impl<'_, T> !Clone for &'_ mut T
, so it looks like this error-generation code path needs to be updated to account for that.Ideally it'd take advantage of the explicit negative here to say that it's not clone and has been promised that it never will be, but at the very least is shouldn't be showing
<&mut T as Clone>
which makes it look like it's actuallyClone
.cc #68318
The text was updated successfully, but these errors were encountered: