Skip to content

internal compiler error: "byte index 15 is not a char boundary" #68629

Closed

Description

@dwrensha

I'm seeing an internal compiler error on the following input (found by fuzz-rustc):

$ echo IBwfdHMAIVt7aQoAACAgZm4gct27b2E+ct27bQ== | base64 --decode > main.rs
$ rustc main.rs
error: unknown start of token: \u{1c}
 --> main.rs:1:2
  |
1 |  ts![{i
  |  ^

error: unknown start of token: \u{1f}
 --> main.rs:1:3
  |
1 |  ts![{i
  |  ^

error: unknown start of token: \u{0}
 --> main.rs:1:6
  |
1 |  ts![{i
  |    ^

error: unknown start of token: \u{0}
 --> main.rs:2:1
  |
2 |   fn rݻoa>rݻm
  | ^

error: unknown start of token: \u{0}
 --> main.rs:2:2
  |
2 |   fn rݻoa>rݻm
  | ^

error: this file contains an unclosed delimiter
 --> main.rs:2:16
  |
1 |  ts![{i
  |     -- unclosed delimiter
  |     |
  |     unclosed delimiter
2 |   fn rݻoa>rݻm
  |              ^

error: macros that expand to items must be delimited with braces or followed by a semicolon
 --> main.rs:1:8
  |
1 |    ts![{i
  |  _____^
2 | |   fn rݻoa>rݻm
  | |_____________^
  |
thread 'rustc' panicked at 'byte index 15 is not a char boundary; it is inside 'ݻ' (bytes 14..16) of `  fn rݻoa>rݻm`', src/libcore/str/mod.rs:2154:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.42.0-nightly (3761dcd34 2020-01-28) running on x86_64-unknown-linux-gnu

error: aborting due to 6 previous errors

My compiler version is:

$ rustc -vV
rustc 1.42.0-nightly (3761dcd34 2020-01-28)
binary: rustc
commit-hash: 3761dcd3467441f78939ccb3b341b03b6a7558d7
commit-date: 2020-01-28
host: x86_64-unknown-linux-gnu
release: 1.42.0-nightly
LLVM version: 9.0

I also observe the error on beta, but not on stable.

Activity

  1. added
    A-parserArea: The lexing & parsing of Rust source code to an AST
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jan 29, 2020
  2. self-assigned this
    on Jan 29, 2020
  3. added a commit that references this issue on Jan 31, 2020
    cdd41ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-parserArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions