-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Description
This code attempts to derive PartialOrd
in an invalid situation, and is rewarded with a barrage of duplicate errors:
#[derive(PartialEq)] struct Comparable;
#[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
The error the trait core::cmp::PartialOrd is not implemented for the type Comparable
only appears once. However, the error binary operation < cannot be applied to type Comparable
(along with note an implementation of std::cmp::PartialOrd might be missing for Comparable
... gee, really?) appears eight times, four for <
and four for >
.
I assume this is because an error is generated at several points within the (invisible) generated PartialOrd
implementation. But since they are all assigned the same span, maybe we can deduplicate.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.