Repository navigation
GAT ICE: dtorck encountered internal error #91985
Description
Activity
- addedC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-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.
on Dec 16, 2021 - addedF-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATs
on Dec 16, 2021 additional notes:
adding
T1::Associated: Cloneto the where for the impl forOuterStructmakes the playground compile. It looks like the compiler should either complain that the associated type is under-specified or implicitly apply the bound.So...uh yeah. Something is wrong here. This playground doesn't work: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d4ac99ec4e25ef340002727b453c5d5c
That doesn't use GATs, just normal associated types. The impl definition doesn't error for a missing
T1::Associated: Clonebound, but we also can't use that in thenewbody.I was scared for a bit that this would be in someway unsound, but it's not.
Okay, so probably the right solution is to make
T1::Associated: Clonebe implied here (rather than requiring that bound). I have a POC branch here: https://github.com/jackh726/rust/tree/issue-91985Unfortunately, it's not as simple as "just make this change". I think either way we run into potential issues. With the above changes, this test passes. But 2 other tests start failing and one has additional errors:
issue-67684.rsgoes from pass to fail. We end up with additional obligations, because now we know thatA::Error = A::Item, but propagate thatA::Item: ParseError(becauseA::Error: ParseError). Kind of needs the reverse: when we seeX: Trait1<Assoc = <Y as Trait2>::Assoc>, we need to also be able to elaborate that any bounds on<Y as Trait2>::Assocalso hold for<X as Trait1>::Assoc.trait-with-supertraits-needing-sized-self.rsgoes from fail to pass. The gist of this is basically when we have something liketrait ArithmeticOps: Add<Output=Self> {}, we currently error becauseSelf: Sizeddoesn't hold. But, with the above branch, we actually imply thatSelf: Sizedholds becauseOutput=Self.issue-47715.rsends up with new "type annotations needed" errors. I don't think these errors are correct.GATs issue triage: not blocking. From above, this is a more general bug with associated types. Not an backwards-incompatibility hazard.
- addedglacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
on Mar 6, 2022 - addedS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issue
on Nov 22, 2022 - addedS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.Status: This bug is tracked inside the repo by a `known-bug` test.
on Apr 15, 2024 - addedA-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)and removedC-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. GATs
on Sep 24, 2024 - added 2 commits that reference this issue
on Feb 4, 2025 - added a commit that references this issue
on Feb 17, 2025 This was fixed by #136539
The issue appeared when following and using the TypeFamily pattern:
Code
Playground link
Meta
rustc --version --verbose:Error output
Backtrace