fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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