GAT with HRTB yields weird inference errors. #96750
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
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code: (playground)
It fails type inference with the following error:
This is super weird because type paramters that don't appear in
Self
type of the impl are not expected to fail inference.Surprisingly, removing
O
makes it pass:Meta
Nightly version: 1.62.0-nightly
(2022-05-03 e1b71fe)
@rustbot label F-generic_associated_types T-compiler A-traits A-inference A-lifetimes
The text was updated successfully, but these errors were encountered: