Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions