Closed Qyriad closed 4 years ago
thank you for the bug report! sounds like the code generation could be a bit more fault tolerant in this case.
Okay, so I should have tested this further before submitting, but this error seems to happen with any strict keyword, which is making me think this might be somewhat related to rust-lang/rust#60524, in which case this is an upstream issue. What I don't understand is the effect capitalization has on it. For another example with more characters, Super
, r#super
, and SUPER
do not compile, but SUper
, SuPer
, sUper
, et cetera do.
Okay, so I should have tested this further before submitting, but this error seems to happen with any strict keyword, which is making me think this might be somewhat related to rust-lang/rust#60524, in which case this is an upstream issue. What I don't understand is the effect capitalization has on it. For another example with more characters,
Super
,r#super
, andSUPER
do not compile, butSUper
,SuPer
,sUper
, et cetera do.
Thanks for the additional research and information. That is actually r#super
strange and you might be right that this is in fact an upstream issue to fix.
Basing off that upstream issue's example code:
macro_rules! m {
($e:expr) => { "expr" };
}
m!(for) // Does not compile
m!(For) // Compiles
Which is making me think that this is related, but still fixable or work-around-able in this repo. I am very Not Familiar with writing procedural macros (or any Rust macros), but given that, I'm wondering if the to_snake_case()
here might be the culprit.
I have not yet taken a proper look into the codebase but your link to the snake_case
method might actually be the key. I will happily accept a PR. However, note that you will probably need to allow some warnings that might be popping up (not sure, just compile and see if there is going to be a warning).
This happens if it's typed as
In
orIN
, butr#in
and most curiouslyiN
do work (butr#In
andr#IN
do not).