rust/src/test/ui/const-generics/generic-function-call-in-array-length.rs
Bastian Kauschke c4ba60a191 update tests
2020-12-26 18:24:10 +01:00

15 lines
458 B
Rust

// revisions: full min
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(const_generics))]
const fn foo(n: usize) -> usize { n * 2 }
fn bar<const N: usize>() -> [u32; foo(N)] {
//[min]~^ ERROR generic parameters may not be used in const operations
//[full]~^^ ERROR constant expression depends on a generic parameter
[0; foo(N)]
//[min]~^ ERROR generic parameters may not be used in const operations
}
fn main() {}