-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Regression in lint for non-exhaustive ZST in repr(Transparent)
#115922
Comments
Ah... good catch. When a type is not "stably 1-ZST" we should just consider it the one non-1-ZST field. Though given that this is a lint right now the logic is a bit trickier... we need to remember if there was a non-1-ZST field, and then
Sadly I won't have the time to work on fixing this quickly. Let me know if you want me to revert the PR. |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
Rollup merge of rust-lang#115924 - compiler-errors:non-exhaustive-1-zst, r=RalfJung Don't complain on a single non-exhaustive 1-ZST r? RalfJung, though you mentioned being busy, so feel free to reassign. This doesn't actually attempt to make the diagnostic better, so when we have two non-exhaustive 1-ZSTs in a struct, we still just point to one. 🤷 Fixes rust-lang#115922
Lifted from #78586
I believe this future compatibility warning was badly affected by #115334. Minimal repro:
As far as I understand what this issue is about, this code should be 100% fine. This issue is about preventing a previously-accepted
repr(transparent)
struct from ending up with contents which a transparent struct is not allowed to have, after a permissible size increase of a non-exhaustive formerly-ZST from a different crate.That's not possible in the code above.
Transparent
continues to be a validrepr(transparent)
struct ifZeroSizedNonExhaustive
increases in size.Regression in nightly-2023-09-18:
@RalfJung @compiler-errors
Originally posted by @dtolnay in #78586 (comment)
The text was updated successfully, but these errors were encountered: