foo<const C: usize>()1 fn foo<const C: usize>() {}
2
3 const BAR: usize = 42;
4
a()5 fn a() {
6 foo<BAR + 3>(); //~ ERROR comparison operators cannot be chained
7 }
b()8 fn b() {
9 foo<BAR + BAR>(); //~ ERROR comparison operators cannot be chained
10 }
c()11 fn c() {
12 foo<3 + 3>(); //~ ERROR comparison operators cannot be chained
13 }
d()14 fn d() {
15 foo<BAR - 3>(); //~ ERROR comparison operators cannot be chained
16 }
e()17 fn e() {
18 foo<BAR - BAR>(); //~ ERROR comparison operators cannot be chained
19 }
f()20 fn f() {
21 foo<100 - BAR>(); //~ ERROR comparison operators cannot be chained
22 }
g()23 fn g() {
24 foo<bar<i32>()>(); //~ ERROR comparison operators cannot be chained
25 //~^ ERROR expected one of `;` or `}`, found `>`
26 }
h()27 fn h() {
28 foo<bar::<i32>()>(); //~ ERROR comparison operators cannot be chained
29 }
i()30 fn i() {
31 foo<bar::<i32>() + BAR>(); //~ ERROR comparison operators cannot be chained
32 }
j()33 fn j() {
34 foo<bar::<i32>() - BAR>(); //~ ERROR comparison operators cannot be chained
35 }
k()36 fn k() {
37 foo<BAR - bar::<i32>()>(); //~ ERROR comparison operators cannot be chained
38 }
l()39 fn l() {
40 foo<BAR - bar::<i32>()>(); //~ ERROR comparison operators cannot be chained
41 }
42
bar<const C: usize>() -> usize43 const fn bar<const C: usize>() -> usize {
44 C
45 }
46
main()47 fn main() {}
48