Skip to content

Renaming a struct field should rename variables that destructure the field #6547

@jyn514

Description

@jyn514

The title is not as clear as it could be - here's an example:

        let Item { attrs, name, source, visibility, def_id, inner, stability, deprecation } = item;

When I rename inner to kind, I expect this to be changed to

        let Item { attrs, name, source, visibility, def_id, kind, stability, deprecation } = item;

and all usages of inner in this scope updated. Instead, rust-analyzer changes it to

        let Item { attrs, name, source, visibility, def_id, kind: inner, stability, deprecation } = item;

which is not super helpful and messes up rustfmt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature requestS-actionableSomeone could pick this issue up and work on it right now

    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