-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Remove the missing_copy_implementations
lint.
#126293
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
Remove the missing_copy_implementations
lint.
#126293
Conversation
This lint made a certain amount of sense for people writing code during the period leading up to to Rust 1.0. It doesn't make much sense today. There are many valid cases of types that could impl `Copy` but do not. The lint is extremely low value and moderately complicated. This commit removes it.
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
Like #126018, this will need an FCP. |
r=me on the code changes themselves, however, I am less certain about removing this lint. I definitely wouldn't be in favor of adding it to rustc right now, but unlike otoh, It does have false positives and if people are unhappy about us removing it, it can get added to clippy (where it belongs) @rfcbot fcp merge |
Team member @lcnr has proposed to merge this. The next step is review by the rest of the tagged team members:
Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Question is if we can add this to clippy from the get-go (are they interested in maintaining such a lint at all? is it technically feasible? is there something that makes this lint uniquely easier to implement in rustc?) |
There's a very similar lint called
Many of them are private though. I'd be fine with putting these lints into clippy if the lints were new. |
No. I think the usefulness for public APIs is more obvious there. The motivation for this PR was the fact that the lint description talks about this lint existing to assist with a pre-1.0 behavioural change, which seems to not be of much relevance any more. |
The API guidelines on interoperability say "crates that define new types should eagerly implement all applicable, common traits" and specifically names The API guidelines on debuggability say "All public types implement Debug" and "If there are exceptions, they are rare." A couple of possible reactions to that.
|
☔ The latest upstream changes (presumably #120924) made this pull request unmergeable. Please resolve the merge conflicts. |
I have personally found this lint to be useful in the past. I don't agree with the motivation at all. |
@rfcbot concern lint-actually-useful
bot wasn't listening |
There is enough opposition to this that I will close it. |
This lint made a certain amount of sense for people writing code during the period leading up to to Rust 1.0. It doesn't make much sense today. There are many valid cases of types that could impl
Copy
but do not. The lint is extremely low value and moderately complicated. This commit removes it.r? @lcnr