]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/expr-as-stmt.stderr
1725ba944c50f6a274a223ea1dcd00dc78656640
[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: parenthesis 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: parenthesis 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: parenthesis 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: parenthesis 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 help: parenthesis are required to parse this as an expression
39    |
40 LL |     (match x {
41 LL |         _ => 1,
42 LL |     }) > 0
43    |
44
45 error[E0308]: mismatched types
46   --> $DIR/expr-as-stmt.rs:7:6
47    |
48 LL |     {2} + {2}
49    |      ^ expected (), found integer
50    |
51    = note: expected type `()`
52               found type `{integer}`
53
54 error[E0308]: mismatched types
55   --> $DIR/expr-as-stmt.rs:12:6
56    |
57 LL |     {2} + 2
58    |      ^ expected (), found integer
59    |
60    = note: expected type `()`
61               found type `{integer}`
62
63 error[E0308]: mismatched types
64   --> $DIR/expr-as-stmt.rs:18:7
65    |
66 LL |     { 42 } + foo;
67    |       ^^ expected (), found integer
68    |
69    = note: expected type `()`
70               found type `{integer}`
71
72 error[E0308]: mismatched types
73   --> $DIR/expr-as-stmt.rs:24:7
74    |
75 LL |     { 3 } * 3
76    |       ^ expected (), found integer
77    |
78    = note: expected type `()`
79               found type `{integer}`
80
81 error[E0614]: type `{integer}` cannot be dereferenced
82   --> $DIR/expr-as-stmt.rs:24:11
83    |
84 LL |     { 3 } * 3
85    |     ----- ^^^
86    |     |
87    |     help: parenthesis are required to parse this as an expression: `({ 3 })`
88
89 error: aborting due to 10 previous errors
90
91 Some errors have detailed explanations: E0308, E0614.
92 For more information about an error, try `rustc --explain E0308`.