I'm using recap https://github.com/softprops/recap to parse some regex-s to structs. In nightly, I am now getting a warning for non_local_definitions (see next message):
#[derive(Debug, Deserialize, Recap, Clone)]
#[recap(regex = r#"^(?P<from>[A-Za-z]+) to (?P<to>[A-Za-z]+) = (?P<distance>\d+)$"#)]
struct Route {
from: Location,
to: Location,
distance: i32,
}
Basically, the macro is generating the code that the nightly compiler doesn't fully like.
I tried adding #[allow(non_local_definitions)] to the struct, but it didn't remove the warning as it is generated in the macro.
I think my options are:
- Move from
nightlytostable- but that just postpones the problem, and I'm using othernightlyfeatures - Submit a ticket to
recap, but it seems rather abandoned and this is anightlyproblem so probably won't be addressed - Fork
recapand fix the issue in my fork, contribute back PR - Move away from
recapto something hand-crafted for parsing regexs to structs - Move away to some alternative to
recapwhich doesn't have this issue - Do something else - not sure what - to just swallow the
non_local_definitionswarnings... but that only postpones the problem.
Suggestions?