fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

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