rust/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs

19 lines
581 B
Rust
Raw Normal View History

// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, feature(generic_const_exprs))]
#![allow(incomplete_features)]
type Arr<const N: usize> = [u8; N - 1];
2020-10-12 22:27:59 +01:00
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR evaluation of `Arr::<0_usize>::{constant#0}` failed
fn test<const N: usize>() -> Arr<N> where [u8; N - 1]: Sized {
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR evaluation of `test::<0_usize>::{constant#0}` failed
todo!()
}
fn main() {
test::<0>();
}