]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/expr-as-stmt.stderr
Auto merge of #86336 - camsteffen:char-array-pattern, r=joshtriplett
[rust.git] / src / test / ui / parser / expr-as-stmt.stderr
1 error: expected expression, found `+`
2   --> $DIR/expr-as-stmt.rs:8:9
3    |
4 LL |     {2} + {2}
5    |         ^ expected expression
6    |
7 help: parentheses are required to parse this as an expression
8    |
9 LL |     ({2}) + {2}
10    |     +   +
11
12 error: leading `+` is not supported
13   --> $DIR/expr-as-stmt.rs:13:9
14    |
15 LL |     {2} + 2
16    |         ^ unexpected `+`
17    |
18 help: parentheses are required to parse this as an expression
19    |
20 LL |     ({2}) + 2
21    |     +   +
22
23 error: expected expression, found `+`
24   --> $DIR/expr-as-stmt.rs:19:12
25    |
26 LL |     { 42 } + foo;
27    |            ^ expected expression
28    |
29 help: parentheses are required to parse this as an expression
30    |
31 LL |     ({ 42 }) + foo;
32    |     +      +
33
34 error: expected expression, found `>`
35   --> $DIR/expr-as-stmt.rs:32:7
36    |
37 LL |     } > 0
38    |       ^ expected expression
39    |
40 help: parentheses are required to parse this as an expression
41    |
42 LL ~     (match x {
43 LL |         _ => 1,
44 LL ~     }) > 0
45    |
46
47 error[E0308]: mismatched types
48   --> $DIR/expr-as-stmt.rs:8:6
49    |
50 LL |     {2} + {2}
51    |      ^ expected `()`, found integer
52    |
53 help: you might have meant to return this value
54    |
55 LL |     {return 2;} + {2}
56    |      ++++++  +
57
58 error[E0308]: mismatched types
59   --> $DIR/expr-as-stmt.rs:13:6
60    |
61 LL |     {2} + 2
62    |      ^ expected `()`, found integer
63    |
64 help: you might have meant to return this value
65    |
66 LL |     {return 2;} + 2
67    |      ++++++  +
68
69 error[E0308]: mismatched types
70   --> $DIR/expr-as-stmt.rs:19:7
71    |
72 LL |     { 42 } + foo;
73    |       ^^ expected `()`, found integer
74    |
75 help: you might have meant to return this value
76    |
77 LL |     { return 42; } + foo;
78    |       ++++++   +
79
80 error[E0308]: mismatched types
81   --> $DIR/expr-as-stmt.rs:25:7
82    |
83 LL |     { 3 } * 3
84    |       ^ expected `()`, found integer
85    |
86 help: you might have meant to return this value
87    |
88 LL |     { return 3; } * 3
89    |       ++++++  +
90
91 error[E0614]: type `{integer}` cannot be dereferenced
92   --> $DIR/expr-as-stmt.rs:25:11
93    |
94 LL |     { 3 } * 3
95    |           ^^^
96    |
97 help: parentheses are required to parse this as an expression
98    |
99 LL |     ({ 3 }) * 3
100    |     +     +
101
102 error[E0308]: mismatched types
103   --> $DIR/expr-as-stmt.rs:36:6
104    |
105 LL |     {2} - 2
106    |      ^ expected `()`, found integer
107    |
108 help: you might have meant to return this value
109    |
110 LL |     {return 2;} - 2
111    |      ++++++  +
112
113 error[E0600]: cannot apply unary operator `-` to type `u32`
114   --> $DIR/expr-as-stmt.rs:36:9
115    |
116 LL |     {2} - 2
117    |         ^^^ cannot apply unary operator `-`
118    |
119 help: parentheses are required to parse this as an expression
120    |
121 LL |     ({2}) - 2
122    |     +   +
123
124 error: aborting due to 11 previous errors
125
126 Some errors have detailed explanations: E0308, E0600, E0614.
127 For more information about an error, try `rustc --explain E0308`.