]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/closing-args-token.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / const-generics / closing-args-token.rs
CommitLineData
29967ef6
XL
1// revisions: full min
2
3#![cfg_attr(full, feature(const_generics))]
4#![cfg_attr(full, allow(incomplete_features))]
29967ef6
XL
5
6struct S<const X: u32>;
7struct T<const X: bool>;
8
9fn 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
15fn bad_args_2() {
16 S::<{ 5 + 2 } >> 7>;
17 //~^ ERROR comparison operators cannot be chained
18}
19
20fn bad_args_3() {
21 T::<0 >= 3>;
22 //~^ ERROR expected expression, found `;`
23}
24
25fn bad_args_4() {
26 let mut x = 0;
27 T::<x >>= 2 > 0>;
28 //~^ ERROR comparison operators cannot be chained
29}
30
31fn main() {}