]>
Commit | Line | Data |
---|---|---|
ff7c6d11 | 1 | error: union expressions should have exactly one field |
0731742a | 2 | --> $DIR/union-fields-2.rs:7:13 |
ff7c6d11 | 3 | | |
532ac7d7 | 4 | LL | let u = U {}; |
ff7c6d11 XL |
5 | | ^ |
6 | ||
7 | error: union expressions should have exactly one field | |
0731742a | 8 | --> $DIR/union-fields-2.rs:9:13 |
ff7c6d11 | 9 | | |
532ac7d7 | 10 | LL | let u = U { a: 0, b: 1 }; |
ff7c6d11 XL |
11 | | ^ |
12 | ||
13 | error[E0560]: union `U` has no field named `c` | |
0731742a | 14 | --> $DIR/union-fields-2.rs:10:29 |
ff7c6d11 | 15 | | |
532ac7d7 | 16 | LL | let u = U { a: 0, b: 1, c: 2 }; |
0531ce1d | 17 | | ^ `U` does not have this field |
ff7c6d11 XL |
18 | | |
19 | = note: available fields are: `a`, `b` | |
20 | ||
21 | error: union expressions should have exactly one field | |
0731742a | 22 | --> $DIR/union-fields-2.rs:10:13 |
ff7c6d11 | 23 | | |
532ac7d7 | 24 | LL | let u = U { a: 0, b: 1, c: 2 }; |
ff7c6d11 XL |
25 | | ^ |
26 | ||
27 | error: union expressions should have exactly one field | |
0731742a | 28 | --> $DIR/union-fields-2.rs:12:13 |
ff7c6d11 | 29 | | |
532ac7d7 | 30 | LL | let u = U { ..u }; |
ff7c6d11 XL |
31 | | ^ |
32 | ||
33 | error[E0436]: functional record update syntax requires a struct | |
0731742a | 34 | --> $DIR/union-fields-2.rs:12:19 |
ff7c6d11 | 35 | | |
532ac7d7 | 36 | LL | let u = U { ..u }; |
ff7c6d11 XL |
37 | | ^ |
38 | ||
39 | error: union patterns should have exactly one field | |
0731742a | 40 | --> $DIR/union-fields-2.rs:15:9 |
ff7c6d11 | 41 | | |
532ac7d7 | 42 | LL | let U {} = u; |
ff7c6d11 XL |
43 | | ^^^^ |
44 | ||
45 | error: union patterns should have exactly one field | |
0731742a | 46 | --> $DIR/union-fields-2.rs:17:9 |
ff7c6d11 | 47 | | |
532ac7d7 | 48 | LL | let U { a, b } = u; |
ff7c6d11 XL |
49 | | ^^^^^^^^^^ |
50 | ||
ff7c6d11 | 51 | error: union patterns should have exactly one field |
0731742a | 52 | --> $DIR/union-fields-2.rs:18:9 |
ff7c6d11 | 53 | | |
532ac7d7 | 54 | LL | let U { a, b, c } = u; |
ff7c6d11 XL |
55 | | ^^^^^^^^^^^^^ |
56 | ||
3dfed10e XL |
57 | error[E0026]: union `U` does not have a field named `c` |
58 | --> $DIR/union-fields-2.rs:18:19 | |
59 | | | |
60 | LL | let U { a, b, c } = u; | |
61 | | ^ union `U` does not have this field | |
62 | ||
ff7c6d11 | 63 | error: union patterns should have exactly one field |
0731742a | 64 | --> $DIR/union-fields-2.rs:20:9 |
ff7c6d11 | 65 | | |
532ac7d7 | 66 | LL | let U { .. } = u; |
ff7c6d11 XL |
67 | | ^^^^^^^^ |
68 | ||
69 | error: `..` cannot be used in union patterns | |
0731742a | 70 | --> $DIR/union-fields-2.rs:20:9 |
ff7c6d11 | 71 | | |
532ac7d7 | 72 | LL | let U { .. } = u; |
ff7c6d11 XL |
73 | | ^^^^^^^^ |
74 | ||
75 | error: `..` cannot be used in union patterns | |
0731742a | 76 | --> $DIR/union-fields-2.rs:22:9 |
ff7c6d11 | 77 | | |
532ac7d7 | 78 | LL | let U { a, .. } = u; |
ff7c6d11 XL |
79 | | ^^^^^^^^^^^ |
80 | ||
81 | error: aborting due to 13 previous errors | |
82 | ||
48663c56 | 83 | Some errors have detailed explanations: E0026, E0436, E0560. |
0531ce1d | 84 | For more information about an error, try `rustc --explain E0026`. |