Skip to content

repr_transparent_external_private_fields lint is not totally clear about what exactly triggers the lint #115956

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

Open
compiler-errors opened this issue Sep 19, 2023 · 0 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-repr Area: the `#[repr(stuff)]` attribute C-bug Category: This is a bug. L-repr_transparent_external_private_fields Lint: repr_transparent_external_private_fields T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@compiler-errors
Copy link
Member

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.

Originally posted by @RalfJung in #115924 (comment)

The lint should be clearer about the exact situation where non-exhaustive 1-ZSTs can be in repr(transparent) structs. After #115924, errors fire more accurately, but error messages are still not totally right in their verbiage.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 19, 2023
@RalfJung RalfJung changed the title repr_transparent_external_private_fields lint is not totally clear about the exact repr_transparent_external_private_fields lint is not totally clear about wht exactly this gets linted Sep 19, 2023
@compiler-errors compiler-errors changed the title repr_transparent_external_private_fields lint is not totally clear about wht exactly this gets linted repr_transparent_external_private_fields lint is not totally clear about what exactly triggers the lint Sep 19, 2023
@fmease fmease added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 19, 2023
@jieyouxu jieyouxu added the L-repr_transparent_external_private_fields Lint: repr_transparent_external_private_fields label May 13, 2024
@workingjubilee workingjubilee added the A-repr Area: the `#[repr(stuff)]` attribute label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-repr Area: the `#[repr(stuff)]` attribute C-bug Category: This is a bug. L-repr_transparent_external_private_fields Lint: repr_transparent_external_private_fields T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants