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 impl_trait #43073

leonardo-m opened this issue Jul 5, 2017 · 2 comments

ICE with impl_trait #43073

leonardo-m opened this issue Jul 5, 2017 · 2 comments


Copy link

@leonardo-m leonardo-m commented Jul 5, 2017

This little program:


fn suffixes(txt: &str) -> impl Iterator<Item=&str> {
    txt.char_indices().skip(1).map(|&(j, _)| &txt[j ..])
fn main() {}


error: internal compiler error: src\librustc_typeck\check\ escaping regions in predicate Obligation(predicate=Binder(ProjectionPredicate(ProjectionTy { trait_ref: <_ as std::iter::Iterator>, item_def_id: DefId { krate: CrateNum(2), node: DefIndex(1577) => core/a635d0d::iter[0]::iterator[0]::Iterator[0]::Item[0] } }, &str)),depth=0)
3 | fn suffixes(txt: &str) -> impl Iterator<Item=&str> {
  |                           ^^^^^^^^^^^^^^^^^^^^^^^^

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report:

note: rustc 1.20.0-nightly (2fbba5bdb 2017-07-04) running on x86_64-pc-windows-gnu
Copy link

@kennytm kennytm commented Jul 5, 2017

Duplicate of #43021 or #42479.

Copy link

@arielb1 arielb1 commented Nov 26, 2017

Closing as duplicate.

@arielb1 arielb1 closed this Nov 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants