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: escaping regions in predicate Obligation(...) #43718

Closed
Manishearth opened this issue Aug 7, 2017 · 2 comments
Closed

ICE: escaping regions in predicate Obligation(...) #43718

Manishearth opened this issue Aug 7, 2017 · 2 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

@Manishearth
Copy link
Member

Manishearth commented Aug 7, 2017

#![feature(conservative_impl_trait)]


fn iter_values(a: &[u32]) -> impl Iterator<Item=&u32>{
    a.iter().map(|a| &a)
}

(playpen )

throws

   Compiling playground v0.0.1 (file:///playground)
error: internal compiler error: /checkout/src/librustc_typeck/check/mod.rs:618: escaping regions in predicate Obligation(predicate=Binder(ProjectionPredicate(ProjectionTy { substs: Slice([_]), item_def_id: DefId { krate: CrateNum(2), node: DefIndex(1591) => core/e78183f::iter[0]::iterator[0]::Iterator[0]::Item[0] } }, &u32)),depth=0)
  --> src/main.rs:21:30
   |
21 |     fn iter_values(&self) -> impl Iterator<Item=&u32>{
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^

note: the compiler unexpectedly panicked. this is a bug.
@Manishearth
Copy link
Member Author

Manishearth commented Aug 7, 2017

cc @petrochenkov @eddyb

@Manishearth Manishearth added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Aug 7, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Aug 10, 2017
@kennytm
Copy link
Member

kennytm commented Aug 20, 2017

Duplicate of #42479

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