Order matters when resolving supertrait #72582
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This code:
gives this error:
which indicates that only the
PartialOrd<i32>
impl is being considered. It seems like the only way to fix it at the usage site is something likeOn the other hand, just swapping the order of the supertraits fixes it:
The text was updated successfully, but these errors were encountered: