Skip to content

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

Open
@compiler-errors

Description

@compiler-errors

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-reprArea: the `#[repr(stuff)]` attributeC-bugCategory: This is a bug.L-repr_transparent_external_private_fieldsLint: repr_transparent_external_private_fieldsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions