Skip to content

Can't rename local that is defined in a macro declaration #20386

@svix-jplatte

Description

@svix-jplatte

When trying to rename the field of an enum struct variant, where the enum uses #[derive(external_crate::Trait)], I get the error

Can't rename local that is defined in a macro declaration

rust-analyzer version: 0.4.2562-standalone
rustc version: 1.90.0-nightly (9748d87dc 2025-07-21)
editor or extension: VSCode (0.4.2562)

code snippet to reproduce:

#[derive(serde::Serialize)]
enum Foo {
    Bar {
        // try renaming this field using F2 in VSCode
        x: u64,
    },
}

Metadata

Metadata

Labels

C-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions