From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/repr/repr-transparent.stderr | 90 ++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 src/test/ui/repr/repr-transparent.stderr (limited to 'src/test/ui/repr/repr-transparent.stderr') diff --git a/src/test/ui/repr/repr-transparent.stderr b/src/test/ui/repr/repr-transparent.stderr new file mode 100644 index 000000000..f1c570b95 --- /dev/null +++ b/src/test/ui/repr/repr-transparent.stderr @@ -0,0 +1,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, ::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 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(ZstAlign32, u32); + | ^^^^^^^^^^^^^ has alignment 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), + | --- +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 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, baz: u32 } + | ^^^^^^^^^^^^^^^^^^ has alignment 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`. -- cgit v1.2.3