Skip to content

internal compiler error: "byte index 4 is not a char boundary" #69130

Closed
@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.

Metadata

Metadata

Assignees

Labels

A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyA-type-systemArea: Type systemC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions