Skip to content

multi macro_rules with the same name, rename failed #17855

@A4-Tacks

Description

@A4-Tacks

rust-analyzer version: rust-analyzer 1.82.0-nightly (7c2012d 2024-07-26)

rustc version: rustc 1.82.0-nightly (7c2012d 2024-07-26)

editor or extension: Vim9.1 coc-rust-analyzer

code snippet to reproduce:

fn main() {
    macro_rules! foo {
        () => {
            1
        };
    }
    assert_eq!(foo!(), 1);
    macro_rules! foo {
        () => {
            2
        };
    }
    assert_eq!(foo!(), 2); // in this line rename `foo`
}

rename foo into bar

fn main() {
    macro_rules! foo {
        () => {
            1
        };
    }
    assert_eq!(bar!(), 1);
    macro_rules! bar {
        () => {
            2
        };
    }
    assert_eq!(bar!(), 2); // in this line rename `foo`
}

expect output:

fn main() {
    macro_rules! foo {
        () => {
            1
        };
    }
    assert_eq!(foo!(), 1);
    macro_rules! bar {
        () => {
            2
        };
    }
    assert_eq!(bar!(), 2); // in this line rename `foo`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-idegeneral IDE featuresA-nameresname, path and module resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions