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.
This code attempts to derive
PartialOrdin an invalid situation, and is rewarded with a barrage of duplicate errors:The error
the trait core::cmp::PartialOrd is not implemented for the type Comparableonly appears once. However, the errorbinary operation < cannot be applied to type Comparable(along with notean 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
PartialOrdimplementation. But since they are all assigned the same span, maybe we can deduplicate.