aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/const_generics_15.rs
blob: a160abf59f1ceda82325ecef8c1b44f5db5c708b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[lang = "sized"]
trait Sized {}

enum Foo<const N: usize> {
    A([u8; N]),
}

union Bar<const N: usize> {
    a: [i32; N],
    b: [u8; N],
}

fn main() {
    let _ = Foo::<4>::A([1, 2, 3, 4]);
    let _ = Bar::<4> { a: [0; 4] };
}