rust/tests/ui/const-generics/issues/issue-71169.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
374 B
Rust
Raw Normal View History

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