Skip to content

Lint potential uses of non_exhaustive #2017

Closed
@clarfonthey

Description

@clarfonthey

Once rust-lang/rust#44109 merges, instances like this:

struct Test {
    pub val: u32,
    _priv: (),
}

Can be better worded as:

#[non_exhaustive]
struct Test {
    pub val: u32,
}

Additionally, having a unit variant at the end of an enum which is doc(hidden) should be marked as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-unnecessaryLint: Warn about unnecessary codeT-ASTType: Requires working with the ASTgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions