summary refs log tree commit diff
path: root/src/test/ui/const-generics/const_evaluatable_checked/simple.rs
blob: dcf0071cb29b6eb5898367e390d3200939075243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// [full] run-pass
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(min, feature(min_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]);
}