]> git.proxmox.com Git - rustc.git/blame - src/test/ui/parser/expr-as-stmt.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / parser / expr-as-stmt.stderr
CommitLineData
48663c56 1error: expected expression, found `+`
136023e0 2 --> $DIR/expr-as-stmt.rs:8:9
48663c56
XL
3 |
4LL | {2} + {2}
94222f64
XL
5 | ^ expected expression
6 |
7help: parentheses are required to parse this as an expression
8 |
9LL | ({2}) + {2}
10 | + +
48663c56 11
c295e0f8 12error: leading `+` is not supported
136023e0 13 --> $DIR/expr-as-stmt.rs:13:9
48663c56
XL
14 |
15LL | {2} + 2
c295e0f8 16 | ^ unexpected `+`
94222f64
XL
17 |
18help: parentheses are required to parse this as an expression
19 |
20LL | ({2}) + 2
21 | + +
48663c56
XL
22
23error: expected expression, found `+`
136023e0 24 --> $DIR/expr-as-stmt.rs:19:12
48663c56
XL
25 |
26LL | { 42 } + foo;
94222f64
XL
27 | ^ expected expression
28 |
29help: parentheses are required to parse this as an expression
30 |
31LL | ({ 42 }) + foo;
32 | + +
48663c56 33
48663c56 34error: expected expression, found `>`
136023e0 35 --> $DIR/expr-as-stmt.rs:32:7
48663c56
XL
36 |
37LL | } > 0
38 | ^ expected expression
e74abb32 39 |
48663c56
XL
40help: parentheses are required to parse this as an expression
41 |
94222f64 42LL ~ (match x {
48663c56 43LL | _ => 1,
94222f64 44LL ~ }) > 0
48663c56
XL
45 |
46
5e7ed085
FG
47error: expected parameter name, found `{`
48 --> $DIR/expr-as-stmt.rs:41:16
49 |
50LL | { true } | { true }
51 | ^ expected parameter name
52 |
53help: parentheses are required to parse this as an expression
54 |
55LL | ({ true }) | { true }
56 | + +
57
58error[E0308]: mismatched types
59 --> $DIR/expr-as-stmt.rs:64:7
60 |
61LL | { foo() } || { true }
62 | ^^^^^- help: consider using a semicolon here: `;`
63 | |
64 | expected `()`, found `i32`
65
48663c56 66error[E0308]: mismatched types
136023e0 67 --> $DIR/expr-as-stmt.rs:8:6
48663c56
XL
68 |
69LL | {2} + {2}
60c5eb7d 70 | ^ expected `()`, found integer
6a06907d
XL
71 |
72help: you might have meant to return this value
73 |
74LL | {return 2;} + {2}
94222f64 75 | ++++++ +
48663c56
XL
76
77error[E0308]: mismatched types
136023e0 78 --> $DIR/expr-as-stmt.rs:13:6
48663c56
XL
79 |
80LL | {2} + 2
60c5eb7d 81 | ^ expected `()`, found integer
6a06907d
XL
82 |
83help: you might have meant to return this value
84 |
85LL | {return 2;} + 2
94222f64 86 | ++++++ +
48663c56
XL
87
88error[E0308]: mismatched types
136023e0 89 --> $DIR/expr-as-stmt.rs:19:7
48663c56
XL
90 |
91LL | { 42 } + foo;
60c5eb7d 92 | ^^ expected `()`, found integer
6a06907d
XL
93 |
94help: you might have meant to return this value
95 |
96LL | { return 42; } + foo;
94222f64 97 | ++++++ +
48663c56
XL
98
99error[E0308]: mismatched types
136023e0 100 --> $DIR/expr-as-stmt.rs:25:7
48663c56
XL
101 |
102LL | { 3 } * 3
60c5eb7d 103 | ^ expected `()`, found integer
6a06907d
XL
104 |
105help: you might have meant to return this value
106 |
107LL | { return 3; } * 3
94222f64 108 | ++++++ +
48663c56
XL
109
110error[E0614]: type `{integer}` cannot be dereferenced
136023e0 111 --> $DIR/expr-as-stmt.rs:25:11
48663c56
XL
112 |
113LL | { 3 } * 3
94222f64
XL
114 | ^^^
115 |
116help: parentheses are required to parse this as an expression
117 |
118LL | ({ 3 }) * 3
119 | + +
48663c56 120
c295e0f8
XL
121error[E0308]: mismatched types
122 --> $DIR/expr-as-stmt.rs:36:6
123 |
124LL | {2} - 2
125 | ^ expected `()`, found integer
126 |
127help: you might have meant to return this value
128 |
129LL | {return 2;} - 2
130 | ++++++ +
131
132error[E0600]: cannot apply unary operator `-` to type `u32`
133 --> $DIR/expr-as-stmt.rs:36:9
134 |
135LL | {2} - 2
136 | ^^^ cannot apply unary operator `-`
137 |
138help: parentheses are required to parse this as an expression
139 |
140LL | ({2}) - 2
141 | + +
142
5e7ed085
FG
143error[E0308]: mismatched types
144 --> $DIR/expr-as-stmt.rs:41:7
145 |
146LL | { true } | { true }
147 | ^^^^ expected `()`, found `bool`
148 |
149help: you might have meant to return this value
150 |
151LL | { return true; } | { true }
152 | ++++++ +
153
154error[E0308]: mismatched types
155 --> $DIR/expr-as-stmt.rs:46:7
156 |
157LL | { true } && { true }
158 | ^^^^ expected `()`, found `bool`
159 |
160help: you might have meant to return this value
161 |
162LL | { return true; } && { true }
163 | ++++++ +
164
165error[E0308]: mismatched types
166 --> $DIR/expr-as-stmt.rs:46:14
167 |
168LL | fn revenge_from_mars() -> bool {
169 | ---- expected `bool` because of return type
170LL | { true } && { true }
171 | ^^^^^^^^^^^ expected `bool`, found `&&bool`
172 |
5e7ed085
FG
173help: parentheses are required to parse this as an expression
174 |
175LL | ({ true }) && { true }
176 | + +
177
178error[E0308]: mismatched types
179 --> $DIR/expr-as-stmt.rs:51:7
180 |
181LL | { true } || { true }
182 | ^^^^ expected `()`, found `bool`
183 |
184help: you might have meant to return this value
185 |
186LL | { return true; } || { true }
187 | ++++++ +
188
189error[E0308]: mismatched types
190 --> $DIR/expr-as-stmt.rs:51:14
191 |
192LL | fn attack_from_mars() -> bool {
193 | ---- expected `bool` because of return type
194LL | { true } || { true }
195 | ^^^^^^^^^^^ expected `bool`, found closure
196 |
197 = note: expected type `bool`
064997fb 198 found closure `[closure@$DIR/expr-as-stmt.rs:51:14: 51:16]`
5e7ed085
FG
199help: parentheses are required to parse this as an expression
200 |
201LL | ({ true }) || { true }
202 | + +
203
204error: aborting due to 18 previous errors
48663c56 205
c295e0f8 206Some errors have detailed explanations: E0308, E0600, E0614.
48663c56 207For more information about an error, try `rustc --explain E0308`.