Skip to content

Suggestion for incorrect repr use #61286

Open
@estebank

Description

@estebank

When encountering #[repr = "C"], suggest #[repr(C)] instead of the current #[repr(C, packed, ...)]. We need to detect specific cases like writing #[repr("packed")], where we should suggest #[repr(packed)], as otherwise provide a list of all the valid reprs.

(Follow up to #61140)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsA-reprArea: the `#[repr(stuff)]` attributeA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`D-papercutDiagnostics: An error or lint that needs small tweaks.P-lowLow priorityT-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