fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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