Failed to unify types when using GATs and HRTBs #93341
Labels
A-GATs
Area: Generic associated types (GATs)
C-bug
Category: This is a bug.
F-generic_associated_types
`#![feature(generic_associated_types)]` a.k.a. GATs
I believe the following code should typecheck under nightly (https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=f3d45f199cadea62341a727f66c52d86):
Note that this uses generic associated types (
AtLifetime<'a>
) and it also uses a higher-rank trait bound infn new
.However, rustc nightly rejects this program with the following error:
I think rustc is wrong to reject this code. As you can see, it fails to unify type
<ExampleMarker as HasLifetime>::AtLifetime<'_>
with typeExampleS<'_>
. But these types should unify!Version of rustc:
1.60.0-nightly 2022-01-25 8cdb3cd94efece1e17cb
.The text was updated successfully, but these errors were encountered: