summaryrefslogtreecommitdiffstats
path: root/tests/ui/repr/repr-transparent.stderr
blob: 028fc25db46cc95c3d37acd091b7f7b64b7244f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
error[E0690]: transparent struct needs at most one non-zero-sized field, but has 2
  --> $DIR/repr-transparent.rs:26:1
   |
LL | struct MultipleNonZst(u8, u8);
   | ^^^^^^^^^^^^^^^^^^^^^ --  -- this field is non-zero-sized
   | |                     |
   | |                     this field is non-zero-sized
   | needs at most one non-zero-sized field, but has 2

error[E0690]: transparent struct needs at most one non-zero-sized field, but has 2
  --> $DIR/repr-transparent.rs:32:1
   |
LL | pub struct StructWithProjection(f32, <f32 as Mirror>::It);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---  ------------------- this field is non-zero-sized
   | |                               |
   | |                               this field is non-zero-sized
   | needs at most one non-zero-sized field, but has 2

error[E0691]: zero-sized field in transparent struct has alignment larger than 1
  --> $DIR/repr-transparent.rs:36:32
   |
LL | struct NontrivialAlignZst(u32, [u16; 0]);
   |                                ^^^^^^^^ has alignment of 2, which is larger than 1

error[E0691]: zero-sized field in transparent struct has alignment larger than 1
  --> $DIR/repr-transparent.rs:42:24
   |
LL | struct GenericAlign<T>(ZstAlign32<T>, u32);
   |                        ^^^^^^^^^^^^^ has alignment of 32, which is larger than 1

error[E0084]: unsupported representation for zero-variant enum
  --> $DIR/repr-transparent.rs:44:1
   |
LL | #[repr(transparent)]
   | ^^^^^^^^^^^^^^^^^^^^
LL | enum Void {}
   | --------- zero-variant enum

error[E0731]: transparent enum needs exactly one variant, but has 0
  --> $DIR/repr-transparent.rs:45:1
   |
LL | enum Void {}
   | ^^^^^^^^^ needs exactly one variant, but has 0

error[E0690]: the variant of a transparent enum needs at most one non-zero-sized field, but has 2
  --> $DIR/repr-transparent.rs:58:1
   |
LL | enum TooManyFieldsEnum {
   | ^^^^^^^^^^^^^^^^^^^^^^ needs at most one non-zero-sized field, but has 2
LL |     Foo(u32, String),
   |         ---  ------ this field is non-zero-sized
   |         |
   |         this field is non-zero-sized

error[E0731]: transparent enum needs exactly one variant, but has 2
  --> $DIR/repr-transparent.rs:64:1
   |
LL | enum MultipleVariants {
   | ^^^^^^^^^^^^^^^^^^^^^ needs exactly one variant, but has 2
LL |     Foo(String),
   |     --- variant here
LL |     Bar,
   |     --- too many variants in `MultipleVariants`

error[E0691]: zero-sized field in transparent enum has alignment larger than 1
  --> $DIR/repr-transparent.rs:71:14
   |
LL |     Foo(u32, [u16; 0]),
   |              ^^^^^^^^ has alignment of 2, which is larger than 1

error[E0691]: zero-sized field in transparent enum has alignment larger than 1
  --> $DIR/repr-transparent.rs:76:11
   |
LL |     Foo { bar: ZstAlign32<T>, baz: u32 }
   |           ^^^^^^^^^^^^^^^^^^ has alignment of 32, which is larger than 1

error[E0690]: transparent union needs at most one non-zero-sized field, but has 2
  --> $DIR/repr-transparent.rs:85:1
   |
LL | union TooManyFields {
   | ^^^^^^^^^^^^^^^^^^^ needs at most one non-zero-sized field, but has 2
LL |     u: u32,
   |     ------ this field is non-zero-sized
LL |     s: i32
   |     ------ this field is non-zero-sized

error: aborting due to 11 previous errors

Some errors have detailed explanations: E0084, E0690, E0691, E0731.
For more information about an error, try `rustc --explain E0084`.