error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 --> $DIR/repr-transparent.rs:21:1 | LL | struct NoFields; //~ ERROR needs exactly one non-zero-sized field | ^^^^^^^^^^^^^^^^ | = note: non-zero-sized field error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 --> $DIR/repr-transparent.rs:24:1 | LL | struct ContainsOnlyZst(()); //~ ERROR needs exactly one non-zero-sized field | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: non-zero-sized field error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 --> $DIR/repr-transparent.rs:27:1 | LL | struct ContainsOnlyZstArray([bool; 0]); //~ ERROR needs exactly one non-zero-sized field | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: non-zero-sized field error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 --> $DIR/repr-transparent.rs:30:1 | LL | struct ContainsMultipleZst(PhantomData<*const i32>, NoFields); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: non-zero-sized field error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 2 --> $DIR/repr-transparent.rs:34:1 | LL | struct MultipleNonZst(u8, u8); //~ ERROR needs exactly one non-zero-sized field | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: non-zero-sized field --> $DIR/repr-transparent.rs:34:23 | LL | struct MultipleNonZst(u8, u8); //~ ERROR needs exactly one non-zero-sized field | ^^ ^^ error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 2 --> $DIR/repr-transparent.rs:40:1 | LL | pub struct StructWithProjection(f32, ::It); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: non-zero-sized field --> $DIR/repr-transparent.rs:40:33 | LL | pub struct StructWithProjection(f32, ::It); | ^^^ ^^^^^^^^^^^^^^^^^^^ error[E0691]: zero-sized field in transparent struct has alignment larger than 1 --> $DIR/repr-transparent.rs:44:32 | LL | struct NontrivialAlignZst(u32, [u16; 0]); //~ ERROR alignment larger than 1 | ^^^^^^^^ error[E0691]: zero-sized field in transparent struct has alignment larger than 1 --> $DIR/repr-transparent.rs:50:24 | LL | struct GenericAlign(ZstAlign32, u32); //~ ERROR alignment larger than 1 | ^^^^^^^^^^^^^ error: aborting due to 8 previous errors Some errors occurred: E0690, E0691. For more information about an error, try `rustc --explain E0690`.