GAT impl with type parameter causes ICE, even without feature enabled #64755
Closed
Description
This also applies to stable rust, since it still ICEs without the feature gate, though of course on stable there's no way to encounter it without having another error due to the feature not being enabled. It's similar to #60654 but with type parameters instead of lifetime parameters. Here's an example (playground link):
struct Foo;
trait MyTrait {
type Item<T>;
}
impl MyTrait for Foo {
type Item<T> = T;
}
This is a bit easier to encounter than that example shows, since type cohesion isn't checked for GATs yet, meaning that you can reproduce this by implementing the normal Iterator trait but still placing a type parameter on the Item type (note for whoever implements that: almost all of the code in rustc_typeck::check::compare_method is reusable there).
Metadata
Assignees
Labels
Area: Generic associated types (GATs)Category: This is a bug.`#![feature(generic_associated_types)]` a.k.a. GATsIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant 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.