-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Don't complain on a single non-exhaustive 1-ZST #115924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,5 +123,45 @@ LL | pub struct T16(Sized, ExternalIndirection<NonExhaustiveVariant>); | |
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/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: aborting due to 12 previous errors | ||
error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types | ||
--> $DIR/repr-transparent-non-exhaustive.rs:97:16 | ||
| | ||
LL | pub struct T17(NonExhaustive, Sized); | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= 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 <https://github.com/rust-lang/rust/issues/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 | ||
--> $DIR/repr-transparent-non-exhaustive.rs:102:31 | ||
| | ||
LL | pub struct T18(NonExhaustive, NonExhaustive); | ||
| ^^^^^^^^^^^^^ | ||
Comment on lines
+136
to
+140
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems fine to land this for now to fix the regression, but could you file a diagnostics issue about this? The error says "zero-sized fields [...] cannot contain external non-exhaustive types" but that's not really accurate, some zero-sized fields can in fact contain such non-exhaustive types. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| | ||
= 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 <https://github.com/rust-lang/rust/issues/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 | ||
--> $DIR/repr-transparent-non-exhaustive.rs:107:31 | ||
| | ||
LL | pub struct T19(NonExhaustive, 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 <https://github.com/rust-lang/rust/issues/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 | ||
--> $DIR/repr-transparent-non-exhaustive.rs:112:32 | ||
| | ||
LL | pub struct T19Flipped(Private, NonExhaustive); | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= 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 <https://github.com/rust-lang/rust/issues/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: aborting due to 16 previous errors | ||
|
Uh oh!
There was an error while loading. Please reload this page.