Skip to content

Lifetime resolution in generic assoc types makes rustc panic #46793

Closed
@mcobzarenco

Description

@mcobzarenco

I wanted to try out the new lifetime resolution in generic associated types merged in #46706.

#![feature(generic_associated_types)]

pub trait Tokenizer {
    type TokenIter<'a>: Iterator<Item = &'a str>;
}

The above makes rustc panic

error: internal compiler error: /checkout/src/librustc/ty/subst.rs:424: Region parameter out of range when substituting in region 'a (root type=Some(&'a str)) (index=1)

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.24.0-nightly (3bee2b44c 2017-12-16) running on x86_64-unknown-linux-gnu

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:449:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.

(rustc version above)

Is this expected behaviour for now?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-GATsArea: Generic associated types (GATs)A-associated-itemsArea: Associated items (types, constants & functions)A-lifetimesArea: Lifetimes / regionsC-bugCategory: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions