Skip to content

[ICE] with universal_impl_trait #46469

@leonardo-m

Description

@leonardo-m

Reduced code:

#![feature(universal_impl_trait, conservative_impl_trait)]
fn bar<'a, 'b>
      (data: impl Iterator<Item=&'a str> + 'b,
      x0: usize, y0: usize,
      spam: &'b [&'b [u8]]) -> impl Iterator<Item=u8> + 'b
where 'a: 'b {
    data.map(move |baz| {
        let (x2, y2) = baz.bytes().fold((x0, y0), |(x, y), c| (x, y));
        spam[y2][x2]
    })
}
fn main() {}

Gives:

error: internal compiler error: src\librustc\ty\subst.rs:424: Region parameter out of range when substituting in region 'b (root type=None) (index=2)

note: rustc 1.24.0-nightly (f9b0897c5 2017-12-02) running on x86_64-pc-windows-gnu

thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:448:8

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions