@@ -31,6 +31,72 @@ help: to write a `const` expression, surround it with braces for it to be unambi
31
31
LL | foo::<{ BAR - BAR }>();
32
32
| ^ ^
33
33
34
+ error: expected one of `,` or `>`, found `(`
35
+ --> $DIR/const-expression-missing-braces.rs:31:19
36
+ |
37
+ LL | foo::<bar<i32>()>();
38
+ | ^ expected one of `,` or `>`
39
+ |
40
+ help: to write a `const` expression, surround it with braces for it to be unambiguous
41
+ |
42
+ LL | foo::<{ bar<i32>() }>();
43
+ | ^ ^
44
+
45
+ error: expected one of `,` or `>`, found `(`
46
+ --> $DIR/const-expression-missing-braces.rs:34:21
47
+ |
48
+ LL | foo::<bar::<i32>()>();
49
+ | ^ expected one of `,` or `>`
50
+ |
51
+ help: to write a `const` expression, surround it with braces for it to be unambiguous
52
+ |
53
+ LL | foo::<{ bar::<i32>() }>();
54
+ | ^ ^
55
+
56
+ error: expected one of `,` or `>`, found `(`
57
+ --> $DIR/const-expression-missing-braces.rs:37:21
58
+ |
59
+ LL | foo::<bar::<i32>() + BAR>();
60
+ | ^ expected one of `,` or `>`
61
+ |
62
+ help: to write a `const` expression, surround it with braces for it to be unambiguous
63
+ |
64
+ LL | foo::<{ bar::<i32>() + BAR }>();
65
+ | ^ ^
66
+
67
+ error: expected one of `,` or `>`, found `(`
68
+ --> $DIR/const-expression-missing-braces.rs:40:21
69
+ |
70
+ LL | foo::<bar::<i32>() - BAR>();
71
+ | ^ expected one of `,` or `>`
72
+ |
73
+ help: to write a `const` expression, surround it with braces for it to be unambiguous
74
+ |
75
+ LL | foo::<{ bar::<i32>() - BAR }>();
76
+ | ^ ^
77
+
78
+ error: expected one of `,` or `>`, found `-`
79
+ --> $DIR/const-expression-missing-braces.rs:43:15
80
+ |
81
+ LL | foo::<BAR - bar::<i32>()>();
82
+ | ^ expected one of `,` or `>`
83
+ |
84
+ help: to write a `const` expression, surround it with braces for it to be unambiguous
85
+ |
86
+ LL | foo::<{ BAR - bar::<i32>() }>();
87
+ | ^ ^
88
+
89
+ error: expected one of `,` or `>`, found `-`
90
+ --> $DIR/const-expression-missing-braces.rs:46:15
91
+ |
92
+ LL | foo::<BAR - bar::<i32>()>();
93
+ | ^ expected one of `,` or `>`
94
+ |
95
+ help: to write a `const` expression, surround it with braces for it to be unambiguous
96
+ |
97
+ LL | foo::<{ BAR - bar::<i32>() }>();
98
+ | ^ ^
99
+
34
100
error: likely `const` expression parsed as trait bounds
35
101
--> $DIR/const-expression-missing-braces.rs:13:11
36
102
|
@@ -42,5 +108,5 @@ help: if you meant to write a `const` expression, surround the expression with b
42
108
LL | foo::<{ BAR + BAR }>();
43
109
| ^ ^
44
110
45
- error: aborting due to 4 previous errors
111
+ error: aborting due to 10 previous errors
46
112
0 commit comments