Skip to content

Suggest private non-default field in some cases #16414

@estebank

Description

@estebank

Description

If all fields private and have a default field value should emit a lint akin to the clippy lint suggesting #[non_exhaustive] to add a private non-default field to prevent construction outside of the current crate.

CC @epage

Version

all

Additional Labels

@rustbot label C-enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messages

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions