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

rustc panics with: assertion failed: match *region { ty::ReLateBound(..) => false, _ => true, } #46446

Closed
tuxmark5 opened this issue Dec 2, 2017 · 1 comment

Comments

@tuxmark5
Copy link

tuxmark5 commented Dec 2, 2017

This code snippet causes rustc to panic:

fn trim_lines(text: &str) -> impl Iterator<Item=&str> {
    let mut prefix_length = 0;
    for c in text.chars() {
      match c {
        ' ' => prefix_length += 1,
        '\n' => continue,
        _ => break,
      }
    }

    text.lines().map(|line| {
      if line.len() >= prefix_length {
        &line[prefix_length..]
      } else {
        line
      }
    })
  }

fn main() {
  trim_lines("hello");
}

Meta

rustc 1.23.0-nightly (33374fa 2017-11-20)
binary: rustc
commit-hash: 33374fa
commit-date: 2017-11-20
host: x86_64-unknown-linux-gnu
release: 1.23.0-nightly
LLVM version: 4.0

The same thing happens with 1.24 nightly too on rust playground.

@arielb1
Copy link
Contributor

arielb1 commented Dec 3, 2017

Duplicate of #42479

@arielb1 arielb1 marked this as a duplicate of #42479 Dec 3, 2017
@arielb1 arielb1 closed this as completed Dec 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants