fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
2.1 KiB81 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
52error[E0308]: mismatched types
53  --> $DIR/expr-as-stmt.rs:12:6
54   |
55LL |     {2} + 2
56   |      ^ expected `()`, found integer
57
58error[E0308]: mismatched types
59  --> $DIR/expr-as-stmt.rs:18:7
60   |
61LL |     { 42 } + foo;
62   |       ^^ expected `()`, found integer
63
64error[E0308]: mismatched types
65  --> $DIR/expr-as-stmt.rs:24:7
66   |
67LL |     { 3 } * 3
68   |       ^ expected `()`, found integer
69
70error[E0614]: type `{integer}` cannot be dereferenced
71  --> $DIR/expr-as-stmt.rs:24:11
72   |
73LL |     { 3 } * 3
74   |     ----- ^^^
75   |     |
76   |     help: parentheses are required to parse this as an expression: `({ 3 })`
77
78error: aborting due to 10 previous errors
79
80Some errors have detailed explanations: E0308, E0614.
81For more information about an error, try `rustc --explain E0308`.