-
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
Warn on non-derived Clone impl on Copy types? #31086
Comments
There are cases where you can't rely on the derived versions (the bounds may be overly conservative for example), but warning when one of the impls is derived an the other is not may be doable? |
I would not want a lint for something like this personally as there are types that are
I think this is a compiler bug kinda but it's unfortunately what we have today. This means that |
@sfackler Is there a case like that where you also have @alexcrichton If this is a lint, |
|
@SimonSapin indeed! My personal opinions on lints is to be far more restrictive to the point that if I ever have to write Either way, however, that's just my personal opinion, and I don't want to digress this issue to talking about lines, I mainly just wanted to point out that such a lint would indeed have false positives (including the cases that @sfackler is mentioning) |
Alright, that’s fair enough. Maybe this lint would belong in Clippy more than rustc? CC @Manishearth |
Yes, this makes sense, we just got a PR for a similar lint for Hash/PartialEq |
cc @mcarton |
Closing since this has been implemented in Clippy. |
From #27750 (comment)
This sounds bad, maybe?
Should we have a lint that warns in this case? Maybe even make it an error after a while?
Sort of related: #31085
The text was updated successfully, but these errors were encountered: