- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Closed
Closed
Copy link
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsC-bugCategory: This is a bug.Category: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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).
Patryk27, chpio, Dushistov, discosultan, luojia65 and 2 more
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsC-bugCategory: This is a bug.Category: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.