-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
update #[derive(Eq)] to not need assert_receiver_is_total_eq #152504
Copy link
Copy link
Open
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
#[derive(Eq)]currently uses the hidden methodEq::assert_receiver_is_total_eqto emit checks that every field of the type being derived on also implementsEq. It would be nice to be able to get rid of it entirely, which requires changing this derive macro to no longer place its checks in this method.Some implementation notes from #149978 (comment):
For this struct:
Instead of generating this:
You would generate this:
One problem is that the
constshould probably also have#[automatically_derived]put on it, but that's currently not permitted.#149978 (comment) contains some more notes on this.
Tracking issue: #152336