Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ICE] with universal_impl_trait #46469

Closed
leonardo-m opened this issue Dec 3, 2017 · 1 comment
Closed

[ICE] with universal_impl_trait #46469

leonardo-m opened this issue Dec 3, 2017 · 1 comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@leonardo-m
Copy link

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
@TimNN TimNN added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Dec 5, 2017
@cramertj
Copy link
Member

cramertj commented Jan 5, 2018

This works on nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants