Repository navigation
ICE: Region parameter out of range when substituting in region... #49362
Copy link
Copy link
Closed
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-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemC-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) ❄️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.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Description
#![feature(generic_associated_types)]
struct S;
trait Trait {
type Associated<'a>;
}
impl Trait for S {
type Associated<'a> = &'a ();
}
fn main() {}error: internal compiler error: librustc/ty/subst.rs:439: Region parameter out of range when substituting in region 'a (root type=Some(TestIterItem<'a>)) (index=0)
thread 'rustc' panicked at 'Box<Any>', librustc_errors/lib.rs:488:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to 2 previous errors
Probably related: #47309
I can reproduce this with rustc 1.26.0-nightly (f5631d9ac 2018-03-24).
Reacted by Thiago Machado
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-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemC-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) ❄️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.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Activity
matthewjasper commentedon Mar 25, 2018
Generic associated types aren't implemented past syntax yet, so this is probably expected. cc #44265
0ndorio commentedon May 8, 2018
This does not only happen with generic associated lifetimes but with any generic associated type:
Rust playground: https://play.rust-lang.org/?gist=c36f51038511f3e6568b1b2c866f2ca3&version=nightly&mode=debug
Maybe its worth to disable the feature flag or add a compiler error warning if the flag is used, until the feature implementation progressed further.
estebank commentedon May 8, 2019
Triage: still happens.
hellow554 commentedon Nov 25, 2019
Slightly reduced, no need for a new
struct S, just use the unit typeestebank commentedon Nov 25, 2019
Closing in favor of #62521.
hellow554 commentedon Nov 26, 2019
@estebank although they are two different ICE messages?
vs
Rollup merge of rust-lang#67160 - matthewjasper:gat-generics, r=nikom…
Rollup merge of rust-lang#67160 - matthewjasper:gat-generics, r=nikom…