-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Weird use
issue
#66
Comments
This is quite peculiar. I figured this is a pretty safe abstraction since importing |
If you need a local helper macro you can use the private variant pattern for macros (I don't know if that fits your use case but it might be something to look at). It looks like this: macro_rules! foo {
// ...
(@myprivatevariant $whatever:tt) => {
}
} |
It wouldn't work unfortunately, since the macros are in different places (one is defined in the |
Was talking to @Vurich who provided me with a better hack to make |
For the sake of future archaeologists, this is the hack: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=59da2fac8e7a17ea287337f7cf5730a5 We need this to emulate this: static TABLE: [Garbage; Token::SIZE] = {
let table = [some_default; Token::SIZE];
table[Token::Foo as usize] = foo_value;
table[Token::Bar as usize] = bar_value;
table
}; without |
This is still an issue that I just ran into with a token at the root of my crate.
What's the clientside workaround currently, and what needs to happen to remove the unneeded export? |
Side note: this might be a bug in rustc. If I'm reading the linked PR correctly, it's supposed to prevent use from the path to the declaration, but the |
I kinda got stuck on this one, the solution I thought would work doesn't really (I either restrict myself to Copy types only or am forced to use macros at levels at which I don't have access to literals). The problem is definitely having two different macro definitions with |
Well, |
Released v0.10.0-rc2 with a fix to this. |
Since I ended up doing some digging that led back to this: rust-lang/rust#53270 is the reason for the error. The macro just wasn't imported from non-crate-root locations and is gated from being imported from crate-root location, so because it had the same name as the type, it made the type unimportable from crate-root location. |
Hey, I ran into this compiler error which I don't understand. Minimal example:
I get the following compiler error:
Interestingly, I cannot reproduce this error with a dummy proc_macro derive I just wrote trying to debug this.
This is on 1.31 stable and I'm using Logos 0.9. Am I missing something? Thanks a lot in advance :)
The text was updated successfully, but these errors were encountered: