blob: f9cb0d2829d6ea84e8f5630cd12335710be16aaa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#![feature(min_const_generics)]
fn test<const N: usize>() {}
fn ok<const M: usize>() -> [u8; M] {
[0; { M }]
}
struct Break0<const N: usize>([u8; { N + 1 }]);
//~^ ERROR generic parameters must not be used inside of non trivial constant values
struct Break1<const N: usize>([u8; { { N } }]);
//~^ ERROR generic parameters must not be used inside of non trivial constant values
fn break2<const N: usize>() {
let _: [u8; N + 1];
//~^ ERROR generic parameters must not be used inside of non trivial constant values
}
fn break3<const N: usize>() {
let _ = [0; N + 1];
//~^ ERROR generic parameters must not be used inside of non trivial constant values
}
trait Foo {
const ASSOC: usize;
}
fn main() {}
|