fork/rust

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

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

master
4.6 KiB104 linesraw
1error[E0690]: transparent struct needs at most one field with non-trivial size or alignment, but has 2
2  --> $DIR/repr-transparent.rs:26:1
3   |
4LL | struct MultipleNonZst(u8, u8);
5   | ^^^^^^^^^^^^^^^^^^^^^ --  -- this field has non-zero size or requires alignment
6   | |                     |
7   | |                     this field has non-zero size or requires alignment
8   | needs at most one field with non-trivial size or alignment, but has 2
9
10error[E0690]: transparent struct needs at most one field with non-trivial size or alignment, but has 2
11  --> $DIR/repr-transparent.rs:32:1
12   |
13LL | pub struct StructWithProjection(f32, <f32 as Mirror>::It);
14   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---  ------------------- this field has non-zero size or requires alignment
15   | |                               |
16   | |                               this field has non-zero size or requires alignment
17   | needs at most one field with non-trivial size or alignment, but has 2
18
19error[E0690]: transparent struct needs at most one field with non-trivial size or alignment, but has 2
20  --> $DIR/repr-transparent.rs:36:1
21   |
22LL | struct NontrivialAlignZst(u32, [u16; 0]);
23   | ^^^^^^^^^^^^^^^^^^^^^^^^^ ---  -------- this field has non-zero size or requires alignment
24   | |                         |
25   | |                         this field has non-zero size or requires alignment
26   | needs at most one field with non-trivial size or alignment, but has 2
27
28error[E0690]: transparent struct needs at most one field with non-trivial size or alignment, but has 2
29  --> $DIR/repr-transparent.rs:42:1
30   |
31LL | struct GenericAlign<T>(ZstAlign32<T>, u32);
32   | ^^^^^^^^^^^^^^^^^^^^^^ -------------  --- this field has non-zero size or requires alignment
33   | |                      |
34   | |                      this field has non-zero size or requires alignment
35   | needs at most one field with non-trivial size or alignment, but has 2
36
37error[E0084]: unsupported representation for zero-variant enum
38  --> $DIR/repr-transparent.rs:47:1
39   |
40LL | #[repr(transparent)]
41   | ^^^^^^^^^^^^^^^^^^^^
42LL | enum Void {}
43   | --------- zero-variant enum
44
45error[E0731]: transparent enum needs exactly one variant, but has 0
46  --> $DIR/repr-transparent.rs:48:1
47   |
48LL | enum Void {}
49   | ^^^^^^^^^ needs exactly one variant, but has 0
50
51error[E0690]: the variant of a transparent enum needs at most one field with non-trivial size or alignment, but has 2
52  --> $DIR/repr-transparent.rs:61:1
53   |
54LL | enum TooManyFieldsEnum {
55   | ^^^^^^^^^^^^^^^^^^^^^^ needs at most one field with non-trivial size or alignment, but has 2
56LL |     Foo(u32, String),
57   |         ---  ------ this field has non-zero size or requires alignment
58   |         |
59   |         this field has non-zero size or requires alignment
60
61error[E0731]: transparent enum needs exactly one variant, but has 2
62  --> $DIR/repr-transparent.rs:67:1
63   |
64LL | enum MultipleVariants {
65   | ^^^^^^^^^^^^^^^^^^^^^ needs exactly one variant, but has 2
66LL |     Foo(String),
67   |     --- variant here
68LL |     Bar,
69   |     --- too many variants in `MultipleVariants`
70
71error[E0690]: the variant of a transparent enum needs at most one field with non-trivial size or alignment, but has 2
72  --> $DIR/repr-transparent.rs:73:1
73   |
74LL | enum NontrivialAlignZstEnum {
75   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ needs at most one field with non-trivial size or alignment, but has 2
76LL |     Foo(u32, [u16; 0]),
77   |         ---  -------- this field has non-zero size or requires alignment
78   |         |
79   |         this field has non-zero size or requires alignment
80
81error[E0690]: the variant of a transparent enum needs at most one field with non-trivial size or alignment, but has 2
82  --> $DIR/repr-transparent.rs:78:1
83   |
84LL | enum GenericAlignEnum<T> {
85   | ^^^^^^^^^^^^^^^^^^^^^^^^ needs at most one field with non-trivial size or alignment, but has 2
86LL |     Foo { bar: ZstAlign32<T>, baz: u32 }
87   |           ------------------  -------- this field has non-zero size or requires alignment
88   |           |
89   |           this field has non-zero size or requires alignment
90
91error[E0690]: transparent union needs at most one field with non-trivial size or alignment, but has 2
92  --> $DIR/repr-transparent.rs:88:1
93   |
94LL | union TooManyFields {
95   | ^^^^^^^^^^^^^^^^^^^ needs at most one field with non-trivial size or alignment, but has 2
96LL |     u: u32,
97   |     ------ this field has non-zero size or requires alignment
98LL |     s: i32
99   |     ------ this field has non-zero size or requires alignment
100
101error: aborting due to 11 previous errors
102
103Some errors have detailed explanations: E0084, E0690, E0731.
104For more information about an error, try `rustc --explain E0084`.