You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0425]: cannot find value `BAR` in module `FooMod`
--> src/main.rs:12:25
|
12 | println!("{}", FooMod::BAR);
| ^^^ not found in `FooMod`
help: possible candidate is found in another module, you can import it into scope
|
3 | use FooMod::BAR;
|
error: aborting due to previous error
Perhaps I'm missing something about how hygiene works in macros 2.0?
The text was updated successfully, but these errors were encountered:
Thanks! I believe this is a duplicate of #46342. The BAR defined in the macro is protected by hygiene 2.0 and cannot be named from the outside the macro. As a workaround, it should work if the name of BAR originates from outside the macro.
Yep the hygiene opt-out is tracked in #39412 where it talks about "hygiene bending".
alexreg
changed the title
Using macro 2.0 to generate a module does not allow access to items
Using Macros 2.0 to generate a module does not allow access to items
Feb 3, 2018
I see no reason why the following code shouldn't work on the latest nightly,
yet I get an odd error.
Perhaps I'm missing something about how hygiene works in macros 2.0?
The text was updated successfully, but these errors were encountered: