summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs
blob: 10ab2fd867cfc5b54d8c1da194d1785246a22f5b (plain)
1
2
3
4
5
6
7
8
9
10
11
type Arr<const N: usize> = [u8; N - 1];
//~^ ERROR generic parameters may not be used in const operations

fn test<const N: usize>() -> Arr<N> where Arr<N>: Default {
    Default::default()
}

fn main() {
    let x = test::<33>();
    assert_eq!(x, [0; 32]);
}