]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs
Merge commit '15c8d31392b9fbab3b3368b67acc4bbe5983115a' into cranelift-rebase
[rust.git] / src / test / ui / const-generics / const_evaluatable_checked / simple_fail.rs
1 // revisions: full min
2 #![cfg_attr(full, feature(const_generics))]
3 #![cfg_attr(full, feature(const_evaluatable_checked))]
4 #![allow(incomplete_features)]
5
6 type Arr<const N: usize> = [u8; N - 1]; //[full]~ ERROR evaluation of constant
7 //[min]~^ ERROR generic parameters may not be used in const operations
8
9 fn test<const N: usize>() -> Arr<N> where [u8; N - 1]: Sized {
10 //[min]~^ ERROR generic parameters may not be used in const operations
11 //[full]~^^ ERROR evaluation of constant
12     todo!()
13 }
14
15 fn main() {
16     test::<0>();
17 }