Closed
Description
rustc 0.13.0-dev (222ae8b 2014-10-18 00:47:22 +0000)
enum Tag {
Dynamic,
Inline(u8),
Static,
}
#[test]
fn f() {
assert_eq!(Inline as uint, 1);
}
compiles and produces
task 'f' failed at 'assertion failed: `(left == right) && (right == left)` (left: `140041300628448`, right: `1`)', foo.rs:9
I think it's casting the constructor function itself as a function pointer? But this is super confusing behavior (caused a segfault in unsafe code) when I just refactored an enum to be not C-like and I want to get rid of remaining occurrences of as uint
.
Also it doesn't warn for as u8
, even though it's too small for a function pointer.