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: no rules expected the token `pub `
--> src/main.rs:15:13
|
15 | $v static ref $name: String = format!($s);
| ^^ no rules expected this token in macro call
...
20 | lazy_string!(pub NOTHING, "nothing");
| ------------------------------------- in this macro invocation
Thanks in advance!
The text was updated successfully, but these errors were encountered:
magiclen
changed the title
How to use the vis specifier inside the macro_rules! macro?
How to use the vis specifier inside the lazy_static! macro?
Apr 30, 2019
Unfortunately the lazy_static macro predates proper macro support for pub(restricted) (which appears to have stabilized in 1.30.0) so it rolls its own. This doesn't appear to be compatible with the proper vis matcher. That's a bit nasty though, so we should look at shifting to vis at some point.
When compiling the code below
Cargo says,
Thanks in advance!
The text was updated successfully, but these errors were encountered: