ICE when casting negative discriminant enum values to anything less than bit width #70114
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-high
High priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Compiling this code on playground:
results in ICE. Casting to anything smaller than
usize
/isize
(u32
,u16
,i16
,u8
,i8
, etc) also results in ICE. Casting to anything same size or larger(u128
,i128
,u64
,i64
, etc) works fine. Positive discriminant values also work fine.Version of rustc:
rustc 1.42.0 (b8cedc004 2020-03-09) running on x86_64-unknown-linux-gnu
(on rust playground)Compiler flags listed as used:
-C codegen-units=1 -C debuginfo=2 --crate-type bin
The text was updated successfully, but these errors were encountered: