Skip to content

Inner item declared by nested macro not resolved #8930

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
flodiebold opened this issue May 22, 2021 · 0 comments · Fixed by #9445
Closed

Inner item declared by nested macro not resolved #8930

flodiebold opened this issue May 22, 2021 · 0 comments · Fixed by #9445
Labels
A-macro macro expansion A-nameres name, path and module resolution S-actionable Someone could pick this issue up and work on it right now

Comments

@flodiebold
Copy link
Member

flodiebold commented May 22, 2021

macro_rules! inner_declare {
    ($ident:ident) => {
        static $ident: u32 = 0;
    };
}
macro_rules! declare {
    ($ident:ident) => {
        inner_declare!($ident);
    };
}

fn foo() {
    declare!(bar);
    bar;
  //^ u32
}

This test fails; bar isn't resolved. Changing declare! to inner_declare! makes it work.

@flodiebold flodiebold added A-macro macro expansion S-actionable Someone could pick this issue up and work on it right now A-nameres name, path and module resolution labels May 22, 2021
@bors bors bot closed this as completed in 920b2c8 Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro macro expansion A-nameres name, path and module resolution S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant