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[E0308]: mismatched types
59 --> $DIR/expr-as-stmt.rs:64:7
61 LL | { foo() } || { true }
62 | ^^^^^- help: consider using a semicolon here: `;`
64 | expected `()`, found `i32`
66 error[E0308]: mismatched types
67 --> $DIR/expr-as-stmt.rs:8:6
70 | ^ expected `()`, found integer
72 help: you might have meant to return this value
74 LL | {return 2;} + {2}
77 error[E0308]: mismatched types
78 --> $DIR/expr-as-stmt.rs:13:6
81 | ^ expected `()`, found integer
83 help: you might have meant to return this value
88 error[E0308]: mismatched types
89 --> $DIR/expr-as-stmt.rs:19:7
92 | ^^ expected `()`, found integer
94 help: you might have meant to return this value
96 LL | { return 42; } + foo;
99 error[E0308]: mismatched types
100 --> $DIR/expr-as-stmt.rs:25:7
103 | ^ expected `()`, found integer
105 help: you might have meant to return this value
107 LL | { return 3; } * 3
110 error[E0614]: type `{integer}` cannot be dereferenced
111 --> $DIR/expr-as-stmt.rs:25:11
116 help: parentheses are required to parse this as an expression
121 error[E0308]: mismatched types
122 --> $DIR/expr-as-stmt.rs:36:6
125 | ^ expected `()`, found integer
127 help: you might have meant to return this value
132 error[E0600]: cannot apply unary operator `-` to type `u32`
133 --> $DIR/expr-as-stmt.rs:36:9
136 | ^^^ cannot apply unary operator `-`
138 help: parentheses are required to parse this as an expression
143 error[E0308]: mismatched types
144 --> $DIR/expr-as-stmt.rs:41:7
146 LL | { true } | { true }
147 | ^^^^ expected `()`, found `bool`
149 help: you might have meant to return this value
151 LL | { return true; } | { true }
154 error[E0308]: mismatched types
155 --> $DIR/expr-as-stmt.rs:46:7
157 LL | { true } && { true }
158 | ^^^^ expected `()`, found `bool`
160 help: you might have meant to return this value
162 LL | { return true; } && { true }
165 error[E0308]: mismatched types
166 --> $DIR/expr-as-stmt.rs:46:14
168 LL | fn revenge_from_mars() -> bool {
169 | ---- expected `bool` because of return type
170 LL | { true } && { true }
171 | ^^^^^^^^^^^ expected `bool`, found `&&bool`
173 help: parentheses are required to parse this as an expression
175 LL | ({ true }) && { true }
178 error[E0308]: mismatched types
179 --> $DIR/expr-as-stmt.rs:51:7
181 LL | { true } || { true }
182 | ^^^^ expected `()`, found `bool`
184 help: you might have meant to return this value
186 LL | { return true; } || { true }
189 error[E0308]: mismatched types
190 --> $DIR/expr-as-stmt.rs:51:14
192 LL | fn attack_from_mars() -> bool {
193 | ---- expected `bool` because of return type
194 LL | { true } || { true }
195 | ^^^^^^^^^^^ expected `bool`, found closure
197 = note: expected type `bool`
198 found closure `[closure@$DIR/expr-as-stmt.rs:51:14: 51:16]`
199 help: parentheses are required to parse this as an expression
201 LL | ({ true }) || { true }
204 error: aborting due to 18 previous errors
206 Some errors have detailed explanations: E0308, E0600, E0614.
207 For more information about an error, try `rustc --explain E0308`.