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 conservative_impl_trait and universal_impl_trait #46470

Closed
leonardo-m opened this issue Dec 3, 2017 · 4 comments
Closed

[ICE] with conservative_impl_trait and universal_impl_trait #46470

leonardo-m opened this issue Dec 3, 2017 · 4 comments
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

#![feature(conservative_impl_trait, universal_impl_trait)]
fn foo(bar: impl Iterator<Item=&str>) -> impl Iterator<Item=u8> {
    bar.map(|_| b'x')
}
fn main() {}

Gives:

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

thread 'rustc' panicked at 'assertion failed: match *region { ty::ReLateBound(..) => false, _ => true, }', src\librustc\infer\higher_ranked\mod.rs:471:8
@cramertj
Copy link
Member

cramertj commented Dec 3, 2017

It's sort of hidden, but I'm pretty sure this is the ICE due to impl Trait return position not properly supporting lifetime elision. The elided lifetime in the argument is still present in the output iterator.

@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

This is #46685.

bors added a commit that referenced this issue Dec 21, 2017
@ghost
Copy link

ghost commented Dec 21, 2017

This wasn't closed automatically.

@cramertj
Copy link
Member

cramertj commented Jan 5, 2018

This is fixed.

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

4 participants