2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(dead_code)]
|
2018-08-31 13:02:01 +00:00
|
|
|
#![allow(deprecated)]
|
|
|
|
|
2015-01-30 07:43:11 +00:00
|
|
|
use std::mem;
|
|
|
|
|
2015-10-18 16:03:42 +00:00
|
|
|
#[derive(PartialEq, Debug)]
|
2015-01-30 07:43:11 +00:00
|
|
|
enum Foo {
|
|
|
|
A(u32),
|
|
|
|
Bar([u16; 4]),
|
|
|
|
C
|
|
|
|
}
|
|
|
|
|
|
|
|
// NOTE(eddyb) Don't make this a const, needs to be a static
|
2023-09-28 08:15:41 +00:00
|
|
|
// so it is always instantiated as an LLVM constant value.
|
2015-01-30 07:43:11 +00:00
|
|
|
static FOO: Foo = Foo::C;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(FOO, Foo::C);
|
|
|
|
assert_eq!(mem::size_of::<Foo>(), 12);
|
|
|
|
assert_eq!(mem::min_align_of::<Foo>(), 4);
|
|
|
|
}
|