Ordering of bounds matters with GAT/HRTB #96321
Labels
A-GATs
Area: Generic associated types (GATs)
A-higher-ranked
Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)
A-inference
Area: Type inference
A-lifetimes
Area: Lifetimes / regions
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
(playground)
I expected to see this happen: program either compiles or requires type annotation for
ReqU
.Instead, this happened: The program fails with a message unrelated to type inference. While reording the bounds as noted or annotating for
ReqU
makes it compile.The error message looks pretty confusing as it seems that the compiler was able to infer
ReqU
!Error Output
Meta
Reproduced on nightly versions back to
2020-05-01
Current nightly:
@rustbot label F-generic_associated_types A-inference T-compiler
The text was updated successfully, but these errors were encountered: