|
1 | 1 | error: expected expression, found `let` statement |
2 | | - --> $DIR/let-chains-assign-add-incorrect.rs:5:8 |
| 2 | + --> $DIR/let-chains-assign-add-incorrect.rs:8:8 |
3 | 3 | | |
4 | | -LL | if let x = 1 && true && y += 2 {}; |
| 4 | +LL | if let _ = 1 && true && y += 2 {}; |
5 | 5 | | ^^^^^^^^^ |
6 | 6 | | |
7 | 7 | = note: only supported directly in conditions of `if` and `while` expressions |
8 | 8 |
|
9 | 9 | error: expected expression, found `let` statement |
10 | | - --> $DIR/let-chains-assign-add-incorrect.rs:18:8 |
| 10 | + --> $DIR/let-chains-assign-add-incorrect.rs:22:8 |
11 | 11 | | |
12 | | -LL | if let x = 1 && y += 2 {}; |
| 12 | +LL | if let _ = 1 && y += 2 {}; |
13 | 13 | | ^^^^^^^^^ |
14 | 14 | | |
15 | 15 | = note: only supported directly in conditions of `if` and `while` expressions |
16 | 16 |
|
17 | 17 | error[E0308]: mismatched types |
18 | | - --> $DIR/let-chains-assign-add-incorrect.rs:5:29 |
| 18 | + --> $DIR/let-chains-assign-add-incorrect.rs:8:29 |
19 | 19 | | |
20 | | -LL | if let x = 1 && true && y += 2 {}; |
| 20 | +LL | if let _ = 1 && true && y += 2 {}; |
21 | 21 | | ----------------- ^ expected `bool`, found integer |
22 | 22 | | | |
23 | 23 | | expected because this is `bool` |
24 | 24 |
|
25 | | -error[E0368]: binary assignment operation `+=` cannot be used in a let chain |
26 | | - --> $DIR/let-chains-assign-add-incorrect.rs:5:31 |
| 25 | +error: binary assignment operation `+=` cannot be used in a let chain |
| 26 | + --> $DIR/let-chains-assign-add-incorrect.rs:8:31 |
27 | 27 | | |
28 | | -LL | if let x = 1 && true && y += 2 {}; |
29 | | - | ^^ cannot use `+=` in a let chain |
| 28 | +LL | if let _ = 1 && true && y += 2 {}; |
| 29 | + | ---------------------- ^^ cannot use `+=` in a let chain |
| 30 | + | | |
| 31 | + | you are add-assigning the right-hand side expression to the result of this let-chain |
30 | 32 | | |
31 | 33 | help: you might have meant to compare with `==` instead of assigning with `+=` |
32 | 34 | | |
33 | | -LL - if let x = 1 && true && y += 2 {}; |
34 | | -LL + if let x = 1 && true && y == 2 {}; |
| 35 | +LL - if let _ = 1 && true && y += 2 {}; |
| 36 | +LL + if let _ = 1 && true && y == 2 {}; |
35 | 37 | | |
36 | 38 |
|
37 | 39 | error[E0308]: mismatched types |
38 | | - --> $DIR/let-chains-assign-add-incorrect.rs:18:21 |
| 40 | + --> $DIR/let-chains-assign-add-incorrect.rs:22:21 |
39 | 41 | | |
40 | | -LL | if let x = 1 && y += 2 {}; |
| 42 | +LL | if let _ = 1 && y += 2 {}; |
41 | 43 | | ^ expected `bool`, found integer |
42 | 44 |
|
43 | | -error[E0368]: binary assignment operation `+=` cannot be used in a let chain |
44 | | - --> $DIR/let-chains-assign-add-incorrect.rs:18:23 |
| 45 | +error: binary assignment operation `+=` cannot be used in a let chain |
| 46 | + --> $DIR/let-chains-assign-add-incorrect.rs:22:23 |
45 | 47 | | |
46 | | -LL | if let x = 1 && y += 2 {}; |
47 | | - | ^^ cannot use `+=` in a let chain |
| 48 | +LL | if let _ = 1 && y += 2 {}; |
| 49 | + | -------------- ^^ cannot use `+=` in a let chain |
| 50 | + | | |
| 51 | + | you are add-assigning the right-hand side expression to the result of this let-chain |
48 | 52 | | |
49 | 53 | help: you might have meant to compare with `==` instead of assigning with `+=` |
50 | 54 | | |
51 | | -LL - if let x = 1 && y += 2 {}; |
52 | | -LL + if let x = 1 && y == 2 {}; |
| 55 | +LL - if let _ = 1 && y += 2 {}; |
| 56 | +LL + if let _ = 1 && y == 2 {}; |
53 | 57 | | |
54 | 58 |
|
55 | 59 | error: aborting due to 6 previous errors |
56 | 60 |
|
57 | | -Some errors have detailed explanations: E0308, E0368. |
58 | | -For more information about an error, try `rustc --explain E0308`. |
| 61 | +For more information about this error, try `rustc --explain E0308`. |
0 commit comments