aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/const_generics_12.rs
blob: a17c52594b1f55d9ca366d2cf07e0dc8795ea658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// { dg-options "-w" }

#[lang = "sized"]
trait Sized {}

const BASE: usize = 2;

struct Foo<T, const N: usize> {
    data: [T; N],
}

fn main() {
    let _ = Foo::<u8, { BASE + 1 * 2 }> { data: [0; 4] };
}