Files
rust/src/test/ui/const-generics/issues/issue-71169.rs

15 lines
529 B
Rust
Raw Normal View History

// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]
2020-07-16 12:14:03 +02:00
fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
//[full]~^ ERROR the type of const parameters must not
//[min]~^^ ERROR the type of const parameters must not
//[min]~| ERROR `[u8; _]` is forbidden as the type of a const generic parameter
2020-07-16 12:14:03 +02:00
fn main() {
const DATA: [u8; 4] = *b"ABCD";
foo::<4, DATA>();
//[full]~^ ERROR constant expression depends on
2020-07-16 12:14:03 +02:00
}