@@ -77,6 +77,15 @@ help: parentheses are required to parse this as an expression
7777LL | (unsafe { 1 }) + unsafe { 1 }
7878 | + +
7979
80+ error: expected `;`, found keyword `match`
81+ --> $DIR/expr-as-stmt.rs:82:53
82+ |
83+ LL | match () { _ => true } && match () { _ => true }
84+ | ^ help: add `;` here
85+ LL |
86+ LL | match () { _ => true } && true;
87+ | ----- unexpected token
88+
8089error[E0308]: mismatched types
8190 --> $DIR/expr-as-stmt.rs:64:7
8291 |
@@ -229,11 +238,7 @@ error[E0308]: mismatched types
229238LL | match () { () => 1 } + match () { () => 1 }
230239 | ^^^^^^^^^^^^^^^^^^^^ expected `()`, found integer
231240 |
232- help: consider using a semicolon here
233- |
234- LL | match () { () => 1 }; + match () { () => 1 }
235- | +
236- help: alternatively, parentheses are required to parse this as an expression
241+ help: parentheses are required to parse this as an expression
237242 |
238243LL | (match () { () => 1 }) + match () { () => 1 }
239244 | + +
@@ -249,7 +254,65 @@ help: you might have meant to return this value
249254LL | unsafe { return 1; } + unsafe { 1 }
250255 | ++++++ +
251256
252- error: aborting due to 22 previous errors
257+ error[E0308]: mismatched types
258+ --> $DIR/expr-as-stmt.rs:81:5
259+ |
260+ LL | match () { _ => true } && match () { _ => true };
261+ | ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `bool`
262+ |
263+ help: parentheses are required to parse this as an expression
264+ |
265+ LL | (match () { _ => true }) && match () { _ => true };
266+ | + +
267+
268+ error[E0308]: mismatched types
269+ --> $DIR/expr-as-stmt.rs:82:5
270+ |
271+ LL | match () { _ => true } && match () { _ => true }
272+ | ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `bool`
273+ |
274+ help: parentheses are required to parse this as an expression
275+ |
276+ LL | (match () { _ => true }) && match () { _ => true }
277+ | + +
278+
279+ error[E0308]: mismatched types
280+ --> $DIR/expr-as-stmt.rs:84:5
281+ |
282+ LL | match () { _ => true } && true;
283+ | ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `bool`
284+ |
285+ help: parentheses are required to parse this as an expression
286+ |
287+ LL | (match () { _ => true }) && true;
288+ | + +
289+
290+ error[E0308]: mismatched types
291+ --> $DIR/expr-as-stmt.rs:85:5
292+ |
293+ LL | match () { _ => true } && true
294+ | ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `bool`
295+ |
296+ help: parentheses are required to parse this as an expression
297+ |
298+ LL | (match () { _ => true }) && true
299+ | + +
300+
301+ error[E0308]: mismatched types
302+ --> $DIR/expr-as-stmt.rs:85:28
303+ |
304+ LL | fn matches() -> bool {
305+ | ---- expected `bool` because of return type
306+ ...
307+ LL | match () { _ => true } && true
308+ | ^^^^^^^ expected `bool`, found `&&bool`
309+ |
310+ help: parentheses are required to parse this as an expression
311+ |
312+ LL | (match () { _ => true }) && true
313+ | + +
314+
315+ error: aborting due to 28 previous errors
253316
254317Some errors have detailed explanations: E0308, E0600, E0614.
255318For more information about an error, try `rustc --explain E0308`.
0 commit comments