-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type system
Description
The following code hits an error:
#![allow(dead_code)]
#[repr(u32)]
enum ValueTag {
INT32 = 0x1FFF0u32 | (0x01 as u32),
X,
}
#[repr(u64)]
enum ValueShiftedTag {
INT32 = ValueTag::INT32 as u64,
X,
}
fn main() {
println!("{}", ValueTag::INT32 as u32);
}
/tmp/a.rs:7:42: 7:53 error: constant evaluation error: can't cast this type [E0080]
/tmp/a.rs:7 INT32 = 0x1FFF0u32 | (0x01 as u32),
^~~~~~~~~~~
Note that the error doesn't reproduce without the ValueShiftedTag
definition.
This blocks the current rust upgrade for Servo.
CC @eddyb.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type system