]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/parser/expr-as-stmt.stderr
Rollup merge of #93400 - ChayimFriedman2:dont-suggest-using-const-with-bounds-unused...
[rust.git] / src / test / ui / parser / expr-as-stmt.stderr
index cae775099e0a03ced8306d34efbe54a3df257290..df0e4dcb16e2cbc57abb68659db7b9e804e1a6ac 100644 (file)
@@ -44,6 +44,25 @@ LL |         _ => 1,
 LL ~     }) > 0
    |
 
+error: expected parameter name, found `{`
+  --> $DIR/expr-as-stmt.rs:41:16
+   |
+LL |     { true } | { true }
+   |                ^ expected parameter name
+   |
+help: parentheses are required to parse this as an expression
+   |
+LL |     ({ true }) | { true }
+   |     +        +
+
+error[E0308]: mismatched types
+  --> $DIR/expr-as-stmt.rs:64:7
+   |
+LL |     { foo() } || { true }
+   |       ^^^^^- help: consider using a semicolon here: `;`
+   |       |
+   |       expected `()`, found `i32`
+
 error[E0308]: mismatched types
   --> $DIR/expr-as-stmt.rs:8:6
    |
@@ -121,7 +140,68 @@ help: parentheses are required to parse this as an expression
 LL |     ({2}) - 2
    |     +   +
 
-error: aborting due to 11 previous errors
+error[E0308]: mismatched types
+  --> $DIR/expr-as-stmt.rs:41:7
+   |
+LL |     { true } | { true }
+   |       ^^^^ expected `()`, found `bool`
+   |
+help: you might have meant to return this value
+   |
+LL |     { return true; } | { true }
+   |       ++++++     +
+
+error[E0308]: mismatched types
+  --> $DIR/expr-as-stmt.rs:46:7
+   |
+LL |     { true } && { true }
+   |       ^^^^ expected `()`, found `bool`
+   |
+help: you might have meant to return this value
+   |
+LL |     { return true; } && { true }
+   |       ++++++     +
+
+error[E0308]: mismatched types
+  --> $DIR/expr-as-stmt.rs:46:14
+   |
+LL | fn revenge_from_mars() -> bool {
+   |                           ---- expected `bool` because of return type
+LL |     { true } && { true }
+   |              ^^^^^^^^^^^ expected `bool`, found `&&bool`
+   |
+help: parentheses are required to parse this as an expression
+   |
+LL |     ({ true }) && { true }
+   |     +        +
+
+error[E0308]: mismatched types
+  --> $DIR/expr-as-stmt.rs:51:7
+   |
+LL |     { true } || { true }
+   |       ^^^^ expected `()`, found `bool`
+   |
+help: you might have meant to return this value
+   |
+LL |     { return true; } || { true }
+   |       ++++++     +
+
+error[E0308]: mismatched types
+  --> $DIR/expr-as-stmt.rs:51:14
+   |
+LL | fn attack_from_mars() -> bool {
+   |                          ---- expected `bool` because of return type
+LL |     { true } || { true }
+   |              ^^^^^^^^^^^ expected `bool`, found closure
+   |
+   = note: expected type `bool`
+           found closure `[closure@$DIR/expr-as-stmt.rs:51:14: 51:25]`
+help: parentheses are required to parse this as an expression
+   |
+LL |     ({ true }) || { true }
+   |     +        +
+
+error: aborting due to 18 previous errors
 
 Some errors have detailed explanations: E0308, E0600, E0614.
 For more information about an error, try `rustc --explain E0308`.