]>
Commit | Line | Data |
---|---|---|
fc512014 XL |
1 | error: expected identifier, found reserved identifier `_` |
2 | --> $DIR/struct_destructure_fail.rs:12:17 | |
3 | | | |
4 | LL | Struct { a, _ } = Struct { a: 1, b: 2 }; | |
5 | | ------ ^ expected identifier, found reserved identifier | |
6 | | | | |
7 | | while parsing this struct | |
8 | ||
29967ef6 | 9 | error: functional record updates are not allowed in destructuring assignments |
fc512014 | 10 | --> $DIR/struct_destructure_fail.rs:14:19 |
29967ef6 XL |
11 | | |
12 | LL | Struct { a, ..d } = Struct { a: 1, b: 2 }; | |
13 | | ^ help: consider removing the trailing pattern | |
14 | ||
15 | error: base expression required after `..` | |
fc512014 | 16 | --> $DIR/struct_destructure_fail.rs:16:19 |
29967ef6 XL |
17 | | |
18 | LL | Struct { a, .. }; | |
19 | | ^ add a base expression here | |
20 | ||
21 | error[E0026]: struct `Struct` does not have a field named `c` | |
22 | --> $DIR/struct_destructure_fail.rs:11:20 | |
23 | | | |
24 | LL | Struct { a, b, c } = Struct { a: 0, b: 1 }; | |
25 | | ^ struct `Struct` does not have this field | |
26 | ||
fc512014 XL |
27 | error[E0027]: pattern does not mention field `b` |
28 | --> $DIR/struct_destructure_fail.rs:12:5 | |
29 | | | |
30 | LL | Struct { a, _ } = Struct { a: 1, b: 2 }; | |
31 | | ^^^^^^^^^^^^^^^ missing field `b` | |
32 | | | |
33 | help: include the missing field in the pattern | |
34 | | | |
5869c6ff XL |
35 | LL | Struct { a, b } = Struct { a: 1, b: 2 }; |
36 | | ^^^^^ | |
fc512014 XL |
37 | help: if you don't care about this missing field, you can explicitly ignore it |
38 | | | |
5869c6ff XL |
39 | LL | Struct { a, .. } = Struct { a: 1, b: 2 }; |
40 | | ^^^^^^ | |
fc512014 XL |
41 | |
42 | error: aborting due to 5 previous errors | |
29967ef6 | 43 | |
fc512014 XL |
44 | Some errors have detailed explanations: E0026, E0027. |
45 | For more information about an error, try `rustc --explain E0026`. |