]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/expr-as-stmt.stderr
83e8880f183f264929e00d9b79e14b2bda542d34
[rust.git] / src / test / ui / parser / expr-as-stmt.stderr
1 error: expected expression, found `+`
2   --> $DIR/expr-as-stmt.rs:7:9
3    |
4 LL |     {2} + {2}
5    |     --- ^ expected expression
6    |     |
7    |     help: parentheses are required to parse this as an expression: `({2})`
8
9 error: expected expression, found `+`
10   --> $DIR/expr-as-stmt.rs:12:9
11    |
12 LL |     {2} + 2
13    |     --- ^ expected expression
14    |     |
15    |     help: parentheses are required to parse this as an expression: `({2})`
16
17 error: expected expression, found `+`
18   --> $DIR/expr-as-stmt.rs:18:12
19    |
20 LL |     { 42 } + foo;
21    |     ------ ^ expected expression
22    |     |
23    |     help: parentheses are required to parse this as an expression: `({ 42 })`
24
25 error: expected expression, found `&&`
26   --> $DIR/expr-as-stmt.rs:30:5
27    |
28 LL |     if let Some(x) = a { true } else { false }
29    |     ------------------------------------------ help: parentheses are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
30 LL |     &&
31    |     ^^ expected expression
32
33 error: expected expression, found `>`
34   --> $DIR/expr-as-stmt.rs:37:7
35    |
36 LL |     } > 0
37    |       ^ expected expression
38    |
39 help: parentheses are required to parse this as an expression
40    |
41 LL |     (match x {
42 LL |         _ => 1,
43 LL |     }) > 0
44    |
45
46 error[E0308]: mismatched types
47   --> $DIR/expr-as-stmt.rs:7:6
48    |
49 LL |     {2} + {2}
50    |      ^ expected (), found integer
51    |
52    = note: expected unit type `()`
53                    found type `{integer}`
54
55 error[E0308]: mismatched types
56   --> $DIR/expr-as-stmt.rs:12:6
57    |
58 LL |     {2} + 2
59    |      ^ expected (), found integer
60    |
61    = note: expected unit type `()`
62                    found type `{integer}`
63
64 error[E0308]: mismatched types
65   --> $DIR/expr-as-stmt.rs:18:7
66    |
67 LL |     { 42 } + foo;
68    |       ^^ expected (), found integer
69    |
70    = note: expected unit type `()`
71                    found type `{integer}`
72
73 error[E0308]: mismatched types
74   --> $DIR/expr-as-stmt.rs:24:7
75    |
76 LL |     { 3 } * 3
77    |       ^ expected (), found integer
78    |
79    = note: expected unit type `()`
80                    found type `{integer}`
81
82 error[E0614]: type `{integer}` cannot be dereferenced
83   --> $DIR/expr-as-stmt.rs:24:11
84    |
85 LL |     { 3 } * 3
86    |     ----- ^^^
87    |     |
88    |     help: parentheses are required to parse this as an expression: `({ 3 })`
89
90 error: aborting due to 10 previous errors
91
92 Some errors have detailed explanations: E0308, E0614.
93 For more information about an error, try `rustc --explain E0308`.