]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-adt-align-mismatch.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / consts / const-adt-align-mismatch.rs
CommitLineData
b7449926 1// run-pass
0bf4aa26 2#![allow(dead_code)]
b7449926
XL
3#![allow(deprecated)]
4
85aaf69f 5use std::mem;
223e47cc 6
b039eaaf 7#[derive(PartialEq, Debug)]
85aaf69f
SL
8enum Foo {
9 A(u32),
10 Bar([u16; 4]),
11 C
12}
223e47cc 13
85aaf69f
SL
14// NOTE(eddyb) Don't make this a const, needs to be a static
15// so it is always instantiated as a LLVM constant value.
16static FOO: Foo = Foo::C;
223e47cc
LB
17
18fn main() {
85aaf69f
SL
19 assert_eq!(FOO, Foo::C);
20 assert_eq!(mem::size_of::<Foo>(), 12);
21 assert_eq!(mem::min_align_of::<Foo>(), 4);
223e47cc 22}