-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Tracking Issue for future-incompatibility lint internal_eq_trait_method_impls #152336
Copy link
Copy link
Open
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is the tracking issue for the
internal_eq_trait_method_implsfuture-compatibility warning and other related errors. The goal of this page is to describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or register a complaint if you feel the change should not be made. For more information on the policy around future-compatibility warnings, see our breaking change policy guidelines.What is the warning for?
The
Eqtrait has the internal, undocumented helper methodassert_receiver_is_total_eq. It was never meant to be implemented by anyone except for the expansion of#[derive(Eq)]. Theinternal_eq_trait_method_implslint will issue a warning for any other implementations of this method.Why was this change made?
The method dates back to the 1.0 release of Rust. Since then, it has gotten new syntax like
const _that will allow the derive macro to no longer need this method. There have also been cases where IDEs detected the presence of the method and automatically added a useless default implementation of the method. To prevent further confusion from this, this future-compatibility warning was added.The lang and libs-api teams approved this lint in #149978 (comment).
Example
Recommendations
Remove any manual implementations of the method and just write
impl Eq for Foo {}.When will this warning become a hard error?
Unknown
Steps
Eq::assert_receiver_is_total_eqand emit FCW on manual impls #149978)Implementation history
Eq::assert_receiver_is_total_eqand emit FCW on manual impls #149978