Macros 2.0: macro defined and used in same function-like scope can't resolve its own items #52389
Labels
A-decl-macros-2-0
Area: Declarative macros 2.0 (#39412)
A-resolve
Area: Name/path resolution done by `rustc_resolve` specifically
F-decl_macro
`#![feature(decl_macro)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
Maybe this is just a misunderstanding of hygiene, but if a macro 2.0 is defined and used in the same function-like scope (function/const) then it can't resolve its own items:
Expected Result
doit()
should resolve to thefn doit
in the scope of the macro, printingHi!
Actual Result
Resolution error.
Note that
const C: ()
was amod _xyz
) does work.cfg(works)
) also works. This error only occurs if the macro is defined and used in the same scope.cc @petrochenkov @nrc
The text was updated successfully, but these errors were encountered: