If I understand right, @Manishearth’s excellent blog post underscores the dangers of omitting hygiene. Of course, macro_rules is also vulnerable to that issue, and we don’t see lots of people running into it (probably because nobody names their constants __arg_0). But he does tantalizingly say that the derive code (which is basically advanced proc macros) could support hygienic idents, so… maybe it isn’t too far away from being exposed to proc macros?
I think I’m understanding more of what you’re going to do though:
- In the 2018 edition, you’ll be able to write a procedural macro and in places where you create an ident, you have to “choose” a
Span but there is only one choice, Span::call_site()
- In a future rustc version after the 2018 edition, other choices will be stabilized, like
Span::gensym() or whatever, so macros written for the 2018 edition can be upgraded
That’s a bit better than what I thought originally, which was that we’d be stuck with Macros 1.2 macros that could never be made hygienic. This doesn’t change my worry about trumpeting new macros yet again when they will still have fairly obvious warts. But it seems like y’all are pretty set on the plan, so I’m glad that my interpretation got more positive 