summary refs log tree commit diff
path: root/src/test/ui/const-generics/const_evaluatable_checked/simple.rs
blob: 94ad71b6c1ac9cfa2d31cba6550c71a2dd6f39e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// [full] run-pass
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![feature(const_evaluatable_checked)]
#![allow(incomplete_features)]

fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
    //[min]~^ ERROR generic parameters
    //[min]~| ERROR generic parameters
    Default::default()
}

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