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

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

13 lines
416 B
Rust
Raw Normal View History

//@ revisions: full min
#![cfg_attr(full, feature(adt_const_params, generic_arg_infer))]
#![cfg_attr(full, allow(incomplete_features))]
2020-07-16 06:03:20 -05:00
fn foo<const N: usize, const A: [u8; N]>() {}
//~^ ERROR the type of const parameters must not
//[min]~| ERROR `[u8; N]` is forbidden as the type of a const generic parameter
2020-07-16 06:03:20 -05:00
fn main() {
2022-01-13 18:17:09 -06:00
foo::<_, { [1] }>();
//[min]~^ ERROR: type provided when a constant was expected
2020-07-16 06:03:20 -05:00
}