]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr
Add tests for `#[no_mangle]` in `impl` blocks that looks like generic `impl` blocks...
[rust.git] / src / test / ui / const-generics / min_const_generics / const-expression-suggest-missing-braces.stderr
1 error: expected one of `,` or `>`, found `3`
2   --> $DIR/const-expression-suggest-missing-braces.rs:6:17
3    |
4 LL |     foo::<BAR + 3>();
5    |                 ^ expected one of `,` or `>`
6    |
7 help: expressions must be enclosed in braces to be used as const generic arguments
8    |
9 LL |     foo::<{ BAR + 3 }>();
10    |           +         +
11
12 error: expressions must be enclosed in braces to be used as const generic arguments
13   --> $DIR/const-expression-suggest-missing-braces.rs:19:11
14    |
15 LL |     foo::<3 + 3>();
16    |           ^^^^^
17    |
18 help: enclose the `const` expression in braces
19    |
20 LL |     foo::<{ 3 + 3 }>();
21    |           +       +
22
23 error: expected one of `,` or `>`, found `-`
24   --> $DIR/const-expression-suggest-missing-braces.rs:22:15
25    |
26 LL |     foo::<BAR - 3>();
27    |               ^ expected one of `,` or `>`
28    |
29 help: expressions must be enclosed in braces to be used as const generic arguments
30    |
31 LL |     foo::<{ BAR - 3 }>();
32    |           +         +
33
34 error: expected one of `,` or `>`, found `-`
35   --> $DIR/const-expression-suggest-missing-braces.rs:25:15
36    |
37 LL |     foo::<BAR - BAR>();
38    |               ^ expected one of `,` or `>`
39    |
40 help: expressions must be enclosed in braces to be used as const generic arguments
41    |
42 LL |     foo::<{ BAR - BAR }>();
43    |           +           +
44
45 error: expressions must be enclosed in braces to be used as const generic arguments
46   --> $DIR/const-expression-suggest-missing-braces.rs:28:11
47    |
48 LL |     foo::<100 - BAR>();
49    |           ^^^^^^^^^
50    |
51 help: enclose the `const` expression in braces
52    |
53 LL |     foo::<{ 100 - BAR }>();
54    |           +           +
55
56 error: expected one of `,` or `>`, found `(`
57   --> $DIR/const-expression-suggest-missing-braces.rs:31:19
58    |
59 LL |     foo::<bar<i32>()>();
60    |                   ^ expected one of `,` or `>`
61    |
62 help: expressions must be enclosed in braces to be used as const generic arguments
63    |
64 LL |     foo::<{ bar<i32>() }>();
65    |           +            +
66
67 error: expected one of `,` or `>`, found `(`
68   --> $DIR/const-expression-suggest-missing-braces.rs:34:21
69    |
70 LL |     foo::<bar::<i32>()>();
71    |                     ^ expected one of `,` or `>`
72    |
73 help: expressions must be enclosed in braces to be used as const generic arguments
74    |
75 LL |     foo::<{ bar::<i32>() }>();
76    |           +              +
77
78 error: expected one of `,` or `>`, found `(`
79   --> $DIR/const-expression-suggest-missing-braces.rs:37:21
80    |
81 LL |     foo::<bar::<i32>() + BAR>();
82    |                     ^ expected one of `,` or `>`
83    |
84 help: expressions must be enclosed in braces to be used as const generic arguments
85    |
86 LL |     foo::<{ bar::<i32>() + BAR }>();
87    |           +                    +
88
89 error: expected one of `,` or `>`, found `(`
90   --> $DIR/const-expression-suggest-missing-braces.rs:40:21
91    |
92 LL |     foo::<bar::<i32>() - BAR>();
93    |                     ^ expected one of `,` or `>`
94    |
95 help: expressions must be enclosed in braces to be used as const generic arguments
96    |
97 LL |     foo::<{ bar::<i32>() - BAR }>();
98    |           +                    +
99
100 error: expected one of `,` or `>`, found `-`
101   --> $DIR/const-expression-suggest-missing-braces.rs:43:15
102    |
103 LL |     foo::<BAR - bar::<i32>()>();
104    |               ^ expected one of `,` or `>`
105    |
106 help: expressions must be enclosed in braces to be used as const generic arguments
107    |
108 LL |     foo::<{ BAR - bar::<i32>() }>();
109    |           +                    +
110
111 error: expected one of `,` or `>`, found `-`
112   --> $DIR/const-expression-suggest-missing-braces.rs:46:15
113    |
114 LL |     foo::<BAR - bar::<i32>()>();
115    |               ^ expected one of `,` or `>`
116    |
117 help: expressions must be enclosed in braces to be used as const generic arguments
118    |
119 LL |     foo::<{ BAR - bar::<i32>() }>();
120    |           +                    +
121
122 error[E0404]: expected trait, found constant `BAR`
123   --> $DIR/const-expression-suggest-missing-braces.rs:11:11
124    |
125 LL |     foo::<BAR + BAR>();
126    |           ^^^ not a trait
127
128 error[E0404]: expected trait, found constant `BAR`
129   --> $DIR/const-expression-suggest-missing-braces.rs:11:17
130    |
131 LL |     foo::<BAR + BAR>();
132    |                 ^^^ not a trait
133
134 warning: trait objects without an explicit `dyn` are deprecated
135   --> $DIR/const-expression-suggest-missing-braces.rs:11:11
136    |
137 LL |     foo::<BAR + BAR>();
138    |           ^^^^^^^^^ help: use `dyn`: `dyn BAR + BAR`
139    |
140    = note: `#[warn(bare_trait_objects)]` on by default
141    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
142    = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
143
144 error[E0747]: type provided when a constant was expected
145   --> $DIR/const-expression-suggest-missing-braces.rs:11:11
146    |
147 LL |     foo::<BAR + BAR>();
148    |           ^^^^^^^^^
149
150 error: aborting due to 14 previous errors; 1 warning emitted
151
152 Some errors have detailed explanations: E0404, E0747.
153 For more information about an error, try `rustc --explain E0404`.