]>
Commit | Line | Data |
---|---|---|
29967ef6 XL |
1 | // revisions: full min |
2 | ||
3 | #![cfg_attr(full, feature(const_generics))] | |
4 | #![cfg_attr(full, allow(incomplete_features))] | |
29967ef6 XL |
5 | |
6 | struct S<const X: u32>; | |
7 | struct T<const X: bool>; | |
8 | ||
9 | fn bad_args_1() { | |
10 | S::<5 + 2 >> 7>; | |
11 | //~^ ERROR expressions must be enclosed in braces to be used as const generic arguments | |
12 | //~| ERROR comparison operators cannot be chained | |
13 | } | |
14 | ||
15 | fn bad_args_2() { | |
16 | S::<{ 5 + 2 } >> 7>; | |
17 | //~^ ERROR comparison operators cannot be chained | |
18 | } | |
19 | ||
20 | fn bad_args_3() { | |
21 | T::<0 >= 3>; | |
22 | //~^ ERROR expected expression, found `;` | |
23 | } | |
24 | ||
25 | fn bad_args_4() { | |
26 | let mut x = 0; | |
27 | T::<x >>= 2 > 0>; | |
28 | //~^ ERROR comparison operators cannot be chained | |
29 | } | |
30 | ||
31 | fn main() {} |