Closed
Description
Transmuting a fieldless enum to it's integer type causes the optimizer to lose track of it's possible values. Note that as
casts are optimized correctly.
Example:
#[repr(u32)]
enum E { X = 0 }
fn f(x: E) {
assert_eq!(unsafe { core::mem::transmute::<E, i32>(x) }, 0); // Not optimized out
assert_eq!(x as i32, 0); // optimized out
}