-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.