1 error: expected expression, found `+`
2 --> $DIR/expr-as-stmt.rs:8:9
5 | ^ expected expression
7 help: parentheses are required to parse this as an expression
12 error: leading `+` is not supported
13 --> $DIR/expr-as-stmt.rs:13:9
18 help: parentheses are required to parse this as an expression
23 error: expected expression, found `+`
24 --> $DIR/expr-as-stmt.rs:19:12
27 | ^ expected expression
29 help: parentheses are required to parse this as an expression
34 error: expected expression, found `>`
35 --> $DIR/expr-as-stmt.rs:32:7
38 | ^ expected expression
40 help: parentheses are required to parse this as an expression
47 error: expected parameter name, found `{`
48 --> $DIR/expr-as-stmt.rs:41:16
50 LL | { true } | { true }
51 | ^ expected parameter name
53 help: parentheses are required to parse this as an expression
55 LL | ({ true }) | { true }
58 error: expected expression, found `+`
59 --> $DIR/expr-as-stmt.rs:69:26
61 LL | match () { () => 1 } + match () { () => 1 }
62 | ^ expected expression
64 help: parentheses are required to parse this as an expression
66 LL | (match () { () => 1 }) + match () { () => 1 }
69 error: expected expression, found `+`
70 --> $DIR/expr-as-stmt.rs:75:18
72 LL | unsafe { 1 } + unsafe { 1 }
73 | ^ expected expression
75 help: parentheses are required to parse this as an expression
77 LL | (unsafe { 1 }) + unsafe { 1 }
80 error[E0308]: mismatched types
81 --> $DIR/expr-as-stmt.rs:64:7
83 LL | { foo() } || { true }
84 | ^^^^^- help: consider using a semicolon here: `;`
86 | expected `()`, found `i32`
88 error[E0308]: mismatched types
89 --> $DIR/expr-as-stmt.rs:8:6
92 | ^ expected `()`, found integer
94 help: you might have meant to return this value
96 LL | {return 2;} + {2}
99 error[E0308]: mismatched types
100 --> $DIR/expr-as-stmt.rs:13:6
103 | ^ expected `()`, found integer
105 help: you might have meant to return this value
110 error[E0308]: mismatched types
111 --> $DIR/expr-as-stmt.rs:19:7
114 | ^^ expected `()`, found integer
116 help: you might have meant to return this value
118 LL | { return 42; } + foo;
121 error[E0308]: mismatched types
122 --> $DIR/expr-as-stmt.rs:25:7
125 | ^ expected `()`, found integer
127 help: you might have meant to return this value
129 LL | { return 3; } * 3
132 error[E0614]: type `{integer}` cannot be dereferenced
133 --> $DIR/expr-as-stmt.rs:25:11
138 help: parentheses are required to parse this as an expression
143 error[E0308]: mismatched types
144 --> $DIR/expr-as-stmt.rs:36:6
147 | ^ expected `()`, found integer
149 help: you might have meant to return this value
154 error[E0600]: cannot apply unary operator `-` to type `u32`
155 --> $DIR/expr-as-stmt.rs:36:9
158 | ^^^ cannot apply unary operator `-`
160 help: parentheses are required to parse this as an expression
165 error[E0308]: mismatched types
166 --> $DIR/expr-as-stmt.rs:41:7
168 LL | { true } | { true }
169 | ^^^^ expected `()`, found `bool`
171 help: you might have meant to return this value
173 LL | { return true; } | { true }
176 error[E0308]: mismatched types
177 --> $DIR/expr-as-stmt.rs:46:7
179 LL | { true } && { true }
180 | ^^^^ expected `()`, found `bool`
182 help: you might have meant to return this value
184 LL | { return true; } && { true }
187 error[E0308]: mismatched types
188 --> $DIR/expr-as-stmt.rs:46:14
190 LL | fn revenge_from_mars() -> bool {
191 | ---- expected `bool` because of return type
192 LL | { true } && { true }
193 | ^^^^^^^^^^^ expected `bool`, found `&&bool`
195 help: parentheses are required to parse this as an expression
197 LL | ({ true }) && { true }
200 error[E0308]: mismatched types
201 --> $DIR/expr-as-stmt.rs:51:7
203 LL | { true } || { true }
204 | ^^^^ expected `()`, found `bool`
206 help: you might have meant to return this value
208 LL | { return true; } || { true }
211 error[E0308]: mismatched types
212 --> $DIR/expr-as-stmt.rs:51:14
214 LL | fn attack_from_mars() -> bool {
215 | ---- expected `bool` because of return type
216 LL | { true } || { true }
217 | ^^^^^^^^^^^ expected `bool`, found closure
219 = note: expected type `bool`
220 found closure `[closure@$DIR/expr-as-stmt.rs:51:14: 51:16]`
221 help: parentheses are required to parse this as an expression
223 LL | ({ true }) || { true }
226 error[E0308]: mismatched types
227 --> $DIR/expr-as-stmt.rs:69:5
229 LL | match () { () => 1 } + match () { () => 1 }
230 | ^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here
232 | expected `()`, found integer
234 error[E0308]: mismatched types
235 --> $DIR/expr-as-stmt.rs:75:14
237 LL | unsafe { 1 } + unsafe { 1 }
238 | ^ expected `()`, found integer
240 help: you might have meant to return this value
242 LL | unsafe { return 1; } + unsafe { 1 }
245 error: aborting due to 22 previous errors
247 Some errors have detailed explanations: E0308, E0600, E0614.
248 For more information about an error, try `rustc --explain E0308`.