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