Skip to content

Non-ascii prefix in enum variant names causes compiler panic #7869

Closed
@lmjk

Description

@lmjk

The following enum definition in src/main.rs causes panic when running cargo clippy:

enum Tila {
    TyöAlkoi,
    TyöKeskeytyi,
    TyöValmis,
}

fn main() {}

Error message:

thread 'rustc' panicked at 'byte index 3 is not a char boundary; it is inside 'ö' (bytes 2..4) of `Työ`', src/tools/clippy/clippy_lints/src/enum_variants.rs:180:16
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-clippy/issues/new

note: Clippy version: clippy 0.1.56 (09c42c4 2021-10-18)

Metadata

Metadata

Assignees

Labels

I-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions