internal compiler error: "byte index 4 is not a char boundary" · Issue #69130 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@dwrensha

Description

@dwrensha

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

enum F { M (§& u8)} fn main() {}

$ rustc main.rs
error: unknown start of token: \u{a7}
 --> main.rs:2:4
  |
2 | M (§& u8)}
  |    ^

error[E0106]: missing lifetime specifier
 --> main.rs:2:5
  |
2 | M (§& u8)}
  |     ^ expected named lifetime parameter
  |
thread 'rustc' panicked at 'byte index 4 is not a char boundary; it is inside '§' (bytes 3..5) of `M (§& u8)}`', 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.43.0-nightly (a1912f2e8 2020-02-12) running on x86_64-unknown-linux-gnu

error: aborting due to previous error

For more information about this error, try `rustc --explain E0106`.

The error happens on beta and nightly but not on stable.