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

Comments

@Manishearth
Copy link
Member

@Manishearth 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 Manishearth commented Aug 7, 2017

@kennytm
Copy link
Member

@kennytm 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants