Skip to content

References expanded from macros are redundant #16357

@krobelus

Description

@krobelus

Using

macro_rules! use_name {
    ($name:ident) => {
        let $name = 123;
        let $name = 123;
        let $name = 123;
    };
}

fn test() {
    use_name!(name);
}

textDocument/references on (name) reports three occurrences, each with the same location (the macro invocation).
The references seem redundant. We should deduplicate them?

It appears the vscode plugin already duplicates them but that's probably the wrong place to do that.

Found with the "bitflags" crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions