1 #![deny(repr_transparent_external_private_fields)]
3 // aux-build: repr-transparent-non-exhaustive.rs
4 extern crate repr_transparent_non_exhaustive
;
6 use repr_transparent_non_exhaustive
::{
14 pub struct InternalPrivate
{
19 pub struct InternalNonExhaustive
;
21 pub struct InternalIndirection
<T
> {
28 pub struct T1(Sized
, InternalPrivate
);
30 pub struct T2(Sized
, InternalNonExhaustive
);
32 pub struct T3(Sized
, InternalIndirection
<(InternalPrivate
, InternalNonExhaustive
)>);
34 pub struct T4(Sized
, ExternalIndirection
<(InternalPrivate
, InternalNonExhaustive
)>);
37 pub struct T5(Sized
, Private
);
38 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
39 //~| WARN this was previously accepted by the compiler
42 pub struct T6(Sized
, NonExhaustive
);
43 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
44 //~| WARN this was previously accepted by the compiler
47 pub struct T7(Sized
, NonExhaustiveEnum
);
48 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
49 //~| WARN this was previously accepted by the compiler
52 pub struct T8(Sized
, NonExhaustiveVariant
);
53 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
54 //~| WARN this was previously accepted by the compiler
57 pub struct T9(Sized
, InternalIndirection
<Private
>);
58 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
59 //~| WARN this was previously accepted by the compiler
62 pub struct T10(Sized
, InternalIndirection
<NonExhaustive
>);
63 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
64 //~| WARN this was previously accepted by the compiler
67 pub struct T11(Sized
, InternalIndirection
<NonExhaustiveEnum
>);
68 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
69 //~| WARN this was previously accepted by the compiler
72 pub struct T12(Sized
, InternalIndirection
<NonExhaustiveVariant
>);
73 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
74 //~| WARN this was previously accepted by the compiler
77 pub struct T13(Sized
, ExternalIndirection
<Private
>);
78 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
79 //~| WARN this was previously accepted by the compiler
82 pub struct T14(Sized
, ExternalIndirection
<NonExhaustive
>);
83 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
84 //~| WARN this was previously accepted by the compiler
87 pub struct T15(Sized
, ExternalIndirection
<NonExhaustiveEnum
>);
88 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
89 //~| WARN this was previously accepted by the compiler
92 pub struct T16(Sized
, ExternalIndirection
<NonExhaustiveVariant
>);
93 //~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
94 //~| WARN this was previously accepted by the compiler