We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1d11bc commit 98ae8adCopy full SHA for 98ae8ad
src/test/run-pass/type-sizes.rs
@@ -18,6 +18,14 @@ struct w {a: int, b: ()}
18
struct x {a: int, b: (), c: ()}
19
struct y {x: int}
20
21
+enum c1 {
22
+ c1
23
+}
24
+
25
+enum c2 {
26
+ c2 = 1
27
28
29
pub fn main() {
30
assert_eq!(size_of::<u8>(), 1 as uint);
31
assert_eq!(size_of::<u32>(), 4 as uint);
@@ -34,4 +42,8 @@ pub fn main() {
34
42
assert_eq!(size_of::<w>(), size_of::<int>());
35
43
assert_eq!(size_of::<x>(), size_of::<int>());
36
44
assert_eq!(size_of::<int>(), size_of::<y>());
45
46
+ // Make sure enum sizes are correct
47
+ assert_eq!(size_of::<c1>(), 0 as uint);
48
+ assert_eq!(size_of::<c2>(), 1 as uint);
37
49
}
0 commit comments