Skip to content

The complete list of calls outside of macro_rules contains macro_rules local variables within macro_rules #16342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
A4-Tacks opened this issue Jan 10, 2024 · 1 comment · Fixed by #18264
Labels
A-hygiene C-bug Category: bug

Comments

@A4-Tacks
Copy link
Contributor

fn main() {
    macro_rules! foo {
        () => {
            let var = 2;
            dbg!(var);
        };
    }
    foo!();
    var;
}

cargo check

error[E0425]: cannot find value `var` in this scope
 --> src/main.rs:9:5
  |
9 |     var;
  |     ^^^ not found in this scope
  |

from line9 open complete list output

var i32                   [LS]
self::                    [LS]
crate::                   [LS]
foo!() macro_rules! foo   [LS]
main()~ fn()              [LS]
...

rust-analyzer version: rust-analyzer 1.74.0 (79e9716c 2023-11-13) and rust-analyzer 1.77.0-nightly (bf8716f1 2023-12-24)

rustc version: rustc 1.74.0 (79e9716c9 2023-11-13) and rustc 1.77.0-nightly (bf8716f1c 2023-12-24)

relevant settings: NONE

@A4-Tacks A4-Tacks added the C-bug Category: bug label Jan 10, 2024
@Veykril
Copy link
Member

Veykril commented Jan 10, 2024

Hygiene isn't yet implemented in rust-analyzer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-hygiene C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants