From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/repr/invalid_repr_list_help.rs | 17 +++++++++++ src/test/ui/repr/invalid_repr_list_help.stderr | 35 ++++++++++++++++++++++ .../ui/repr/repr-transparent-issue-87496.stderr | 2 +- .../ui/repr/repr-transparent-non-exhaustive.rs | 24 +++++++-------- .../ui/repr/repr-transparent-non-exhaustive.stderr | 30 +++++++++---------- 5 files changed, 80 insertions(+), 28 deletions(-) create mode 100644 src/test/ui/repr/invalid_repr_list_help.rs create mode 100644 src/test/ui/repr/invalid_repr_list_help.stderr (limited to 'src/test/ui/repr') diff --git a/src/test/ui/repr/invalid_repr_list_help.rs b/src/test/ui/repr/invalid_repr_list_help.rs new file mode 100644 index 000000000..c32098453 --- /dev/null +++ b/src/test/ui/repr/invalid_repr_list_help.rs @@ -0,0 +1,17 @@ +#![crate_type = "lib"] + +#[repr(uwu)] //~ERROR: unrecognized representation hint +pub struct OwO; + +#[repr(uwu = "a")] //~ERROR: unrecognized representation hint +pub struct OwO2(i32); + +#[repr(uwu(4))] //~ERROR: unrecognized representation hint +pub struct OwO3 { + x: i32, +} + +#[repr(uwu, u8)] //~ERROR: unrecognized representation hint +pub enum OwO4 { + UwU = 1, +} diff --git a/src/test/ui/repr/invalid_repr_list_help.stderr b/src/test/ui/repr/invalid_repr_list_help.stderr new file mode 100644 index 000000000..2acd56d9a --- /dev/null +++ b/src/test/ui/repr/invalid_repr_list_help.stderr @@ -0,0 +1,35 @@ +error[E0552]: unrecognized representation hint + --> $DIR/invalid_repr_list_help.rs:3:8 + | +LL | #[repr(uwu)] + | ^^^ + | + = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` + +error[E0552]: unrecognized representation hint + --> $DIR/invalid_repr_list_help.rs:6:8 + | +LL | #[repr(uwu = "a")] + | ^^^^^^^^^ + | + = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` + +error[E0552]: unrecognized representation hint + --> $DIR/invalid_repr_list_help.rs:9:8 + | +LL | #[repr(uwu(4))] + | ^^^^^^ + | + = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` + +error[E0552]: unrecognized representation hint + --> $DIR/invalid_repr_list_help.rs:14:8 + | +LL | #[repr(uwu, u8)] + | ^^^ + | + = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0552`. diff --git a/src/test/ui/repr/repr-transparent-issue-87496.stderr b/src/test/ui/repr/repr-transparent-issue-87496.stderr index 3dc13b1c1..aee31212b 100644 --- a/src/test/ui/repr/repr-transparent-issue-87496.stderr +++ b/src/test/ui/repr/repr-transparent-issue-87496.stderr @@ -4,13 +4,13 @@ warning: `extern` block uses type `TransparentCustomZst`, which is not FFI-safe LL | fn good17(p: TransparentCustomZst); | ^^^^^^^^^^^^^^^^^^^^ not FFI-safe | - = note: `#[warn(improper_ctypes)]` on by default = note: this struct contains only zero-sized fields note: the type is defined here --> $DIR/repr-transparent-issue-87496.rs:6:1 | LL | struct TransparentCustomZst(()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(improper_ctypes)]` on by default warning: 1 warning emitted diff --git a/src/test/ui/repr/repr-transparent-non-exhaustive.rs b/src/test/ui/repr/repr-transparent-non-exhaustive.rs index 9ccd8610d..506f1dcf3 100644 --- a/src/test/ui/repr/repr-transparent-non-exhaustive.rs +++ b/src/test/ui/repr/repr-transparent-non-exhaustive.rs @@ -35,62 +35,62 @@ pub struct T4(Sized, ExternalIndirection<(InternalPrivate, InternalNonExhaustive #[repr(transparent)] pub struct T5(Sized, Private); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T6(Sized, NonExhaustive); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T7(Sized, NonExhaustiveEnum); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T8(Sized, NonExhaustiveVariant); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T9(Sized, InternalIndirection); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T10(Sized, InternalIndirection); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T11(Sized, InternalIndirection); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T12(Sized, InternalIndirection); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T13(Sized, ExternalIndirection); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T14(Sized, ExternalIndirection); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T15(Sized, ExternalIndirection); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler #[repr(transparent)] pub struct T16(Sized, ExternalIndirection); -//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types //~| WARN this was previously accepted by the compiler fn main() {} diff --git a/src/test/ui/repr/repr-transparent-non-exhaustive.stderr b/src/test/ui/repr/repr-transparent-non-exhaustive.stderr index 3b1e334a0..16edf59c7 100644 --- a/src/test/ui/repr/repr-transparent-non-exhaustive.stderr +++ b/src/test/ui/repr/repr-transparent-non-exhaustive.stderr @@ -1,19 +1,19 @@ -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:37:22 | LL | pub struct T5(Sized, Private); | ^^^^^^^ | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #78586 + = note: this struct contains `Private`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future. note: the lint level is defined here --> $DIR/repr-transparent-non-exhaustive.rs:1:9 | LL | #![deny(repr_transparent_external_private_fields)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #78586 - = note: this struct contains `Private`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:42:22 | LL | pub struct T6(Sized, NonExhaustive); @@ -23,7 +23,7 @@ LL | pub struct T6(Sized, NonExhaustive); = note: for more information, see issue #78586 = note: this struct contains `NonExhaustive`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:47:22 | LL | pub struct T7(Sized, NonExhaustiveEnum); @@ -33,7 +33,7 @@ LL | pub struct T7(Sized, NonExhaustiveEnum); = note: for more information, see issue #78586 = note: this enum contains `NonExhaustiveEnum`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:52:22 | LL | pub struct T8(Sized, NonExhaustiveVariant); @@ -43,7 +43,7 @@ LL | pub struct T8(Sized, NonExhaustiveVariant); = note: for more information, see issue #78586 = note: this enum contains `NonExhaustiveVariant`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:57:22 | LL | pub struct T9(Sized, InternalIndirection); @@ -53,7 +53,7 @@ LL | pub struct T9(Sized, InternalIndirection); = note: for more information, see issue #78586 = note: this struct contains `Private`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:62:23 | LL | pub struct T10(Sized, InternalIndirection); @@ -63,7 +63,7 @@ LL | pub struct T10(Sized, InternalIndirection); = note: for more information, see issue #78586 = note: this struct contains `NonExhaustive`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:67:23 | LL | pub struct T11(Sized, InternalIndirection); @@ -73,7 +73,7 @@ LL | pub struct T11(Sized, InternalIndirection); = note: for more information, see issue #78586 = note: this enum contains `NonExhaustiveEnum`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:72:23 | LL | pub struct T12(Sized, InternalIndirection); @@ -83,7 +83,7 @@ LL | pub struct T12(Sized, InternalIndirection); = note: for more information, see issue #78586 = note: this enum contains `NonExhaustiveVariant`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:77:23 | LL | pub struct T13(Sized, ExternalIndirection); @@ -93,7 +93,7 @@ LL | pub struct T13(Sized, ExternalIndirection); = note: for more information, see issue #78586 = note: this struct contains `Private`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:82:23 | LL | pub struct T14(Sized, ExternalIndirection); @@ -103,7 +103,7 @@ LL | pub struct T14(Sized, ExternalIndirection); = note: for more information, see issue #78586 = note: this struct contains `NonExhaustive`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:87:23 | LL | pub struct T15(Sized, ExternalIndirection); @@ -113,7 +113,7 @@ LL | pub struct T15(Sized, ExternalIndirection); = note: for more information, see issue #78586 = note: this enum contains `NonExhaustiveEnum`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future. -error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types +error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types --> $DIR/repr-transparent-non-exhaustive.rs:92:23 | LL | pub struct T16(Sized, ExternalIndirection); -- cgit v1.2.3