2020-08-26 18:44:00 +08:00
|
|
|
// 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]>() {}
|
2020-08-26 18:44:00 +08:00
|
|
|
//[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>();
|
2020-08-26 18:44:00 +08:00
|
|
|
//[full]~^ ERROR constant expression depends on
|
2020-07-16 12:14:03 +02:00
|
|
|
}
|