RS.CLIPPY.ENUM_CLIKE_UNPORTABLE_VARIANT

C-like enums that are `repr(isize/usize)` and have values that don't fit into an `i32`

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: enum_clike_unportable_variant. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for C-like enumerations that are repr(isize/usize) and have values that don't fit into an i32.

Why is this bad?

This will truncate the variant value on 32 bit architectures, but works fine on 64 bit.

Example

#[repr(usize)]
enum NonPortable {
    X = 0x1_0000_0000,
    Y = 0,
}