From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/repr/repr-transparent-non-exhaustive.rs | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'tests/ui/repr/repr-transparent-non-exhaustive.rs') diff --git a/tests/ui/repr/repr-transparent-non-exhaustive.rs b/tests/ui/repr/repr-transparent-non-exhaustive.rs index 506f1dcf3..84dd3f492 100644 --- a/tests/ui/repr/repr-transparent-non-exhaustive.rs +++ b/tests/ui/repr/repr-transparent-non-exhaustive.rs @@ -93,4 +93,44 @@ pub struct T16(Sized, ExternalIndirection); //~^ 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 T17(NonExhaustive, Sized); +//~^ 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 T18(NonExhaustive, NonExhaustive); +//~^ 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 T19(NonExhaustive, Private); +//~^ 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 T19Flipped(Private, NonExhaustive); +//~^ 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 T20(NonExhaustive); +// Okay, since it's the only field. + +#[repr(transparent)] +pub struct T21(NonExhaustive, InternalNonExhaustive); +// Okay, since there's only 1 foreign non-exhaustive type. + +#[repr(transparent)] +pub struct T21Flipped(InternalNonExhaustive, NonExhaustive); +// Okay, since there's only 1 foreign non-exhaustive type. + +#[repr(transparent)] +pub struct T22(NonExhaustive, InternalPrivate); +// Okay, since there's only 1 foreign non-exhaustive type. + +#[repr(transparent)] +pub struct T22Flipped(InternalPrivate, NonExhaustive); +// Okay, since there's only 1 foreign non-exhaustive type. + fn main() {} -- cgit v1.2.3