Implement type- and const-generic associated types #67513
Closed
Description
The compiler errors for the following code:
#![feature(generic_associated_types)]
trait X {
type Y<T>;
}
This is due to the compiler having no way to represent the implicit for<T: Sized> Y<T>: Sized
bound on the trait. Some things that would need to be fixed before this can happen are:
- The handling of bound and placeholder types and constants in the compiler needs to be reviewed.
- There needs to be a way to represent traits bounds on bound types. I think the bound above is supposed to become
for<T> if T: Sized { Y<T>: Sized }
. - Maybe Chalk needs to progress further? Without Chalk we can at least get to the point of trait errors due to lack of (lazy) normalization.
cc @rust-lang/wg-traits
Metadata
Assignees
Labels
Area: Generic associated types (GATs)Category: A feature request that has been accepted pending implementation.Call for participation: Hard difficulty. Experience needed to fix: A lot.`#![feature(generic_associated_types)]` a.k.a. GATsRelevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.