rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Macro rules meta variable name raw-variable is not equal

Open A4-Tacks opened this issue 1 year ago • 4 comments

rust-analyzer version: rust-analyzer 1.80.0 (05147895 2024-07-21)

rustc version: rustc 1.80.0 (051478957 2024-07-21)

editor or extension: Vim 9.1 coc-rust-analyzer

code snippet to reproduce:

macro_rules! x {
    ($r#break:tt) => {
        $break
    };
}
fn main() {
    x!(2);
}

rustc: no errors ra: break outside of loop (rust-analyzer E0268)

no error cases:

macro_rules! x {
    ($r#break:tt) => {
        $r#break
    };
}
fn main() {
    x!(2);
}
macro_rules! x {
    ($break:tt) => {
        $break
    };
}
fn main() {
    x!(2);
}

A4-Tacks avatar Aug 04 '24 12:08 A4-Tacks

This seems to be fixed? I cannot reproduce it.

ChayimFriedman2 avatar Aug 16 '24 04:08 ChayimFriedman2

This seems to be fixed? I cannot reproduce it.

rust-analyzer 1.82.0-nightly (7c2012d0 2024-07-26) reproduced

Screenshot_20240816_122510

A4-Tacks avatar Aug 16 '24 04:08 A4-Tacks

This does expand correctly for me as well now on the latest release

Veykril avatar Aug 16 '24 06:08 Veykril

We should add a test for this though I think

Veykril avatar Aug 16 '24 07:08 Veykril

@rustbot claim

rufevean avatar Sep 06 '24 11:09 rufevean

@rustbot release-assignment

rufevean avatar Sep 07 '24 13:09 rufevean

Closed by #18561

lnicola avatar Dec 09 '24 06:12 lnicola