Closed
Description
Many people playing with #[feature(generic_associated_types)]
have noticed that they break very easily when you attempt to use a lifetime formal parameter.
Examples follow
ICE: Region parameter out of range
#![feature(generic_associated_types)]
trait Iterator {
type Item<'a>: 'a;
}
#![feature(generic_associated_types)]
trait Foo {
type PublicKey<'a> : From<&'a [u8]>;
}
#![feature(generic_associated_types)]
trait Trait {
type Associated<'a>;
}
impl Trait for () {
type Associated<'a> = &'a ();
}
ICE: cannot convert ReEarlyBound(0, 'b)
to a region vid
#![feature(generic_associated_types)]
struct Foo;
impl Iterator for Foo {
type Item<'b> = &'b Foo;
fn next(&mut self) -> Option<Self::Item> {
None
}
}
This obviously blocks stabilization of GATs (#44265).
Metadata
Metadata
Assignees
Labels
Area: Generic associated types (GATs)Area: Associated items (types, constants & functions)Area: Lifetimes / regionsCategory: This is a bug.`#![feature(generic_associated_types)]` a.k.a. GATsIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Medium priorityRelevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.