]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/closing-args-token.rs
Auto merge of #79342 - CDirkx:ipaddr-const, r=oli-obk
[rust.git] / src / test / ui / const-generics / closing-args-token.rs
1 // revisions: full min
2
3 #![cfg_attr(full, feature(const_generics))]
4 #![cfg_attr(full, allow(incomplete_features))]
5 #![cfg_attr(min, feature(min_const_generics))]
6
7 struct S<const X: u32>;
8 struct T<const X: bool>;
9
10 fn bad_args_1() {
11     S::<5 + 2 >> 7>;
12     //~^ ERROR expressions must be enclosed in braces to be used as const generic arguments
13     //~| ERROR comparison operators cannot be chained
14 }
15
16 fn bad_args_2() {
17     S::<{ 5 + 2 } >> 7>;
18     //~^ ERROR comparison operators cannot be chained
19 }
20
21 fn bad_args_3() {
22     T::<0 >= 3>;
23     //~^ ERROR expected expression, found `;`
24 }
25
26 fn bad_args_4() {
27     let mut x = 0;
28     T::<x >>= 2 > 0>;
29     //~^ ERROR comparison operators cannot be chained
30 }
31
32 fn main() {}