mystor / synstructure

Utilities for dealing with substructures within syn macros

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow the use of `const _` instead of generating names

nox opened this issue · comments

This was stabilised a year ago.

This would be very nice to do! It will make the output of synstrcture much, much nicer to read (and less likely to cause name conflicts).

Unfortunately, due to the test_derive! macro, changing the generated output code from synstructure will break downstream crates' tests, so this probably has to be changed in a 0.13.0 release, or exposed as an explicit opt-in flag.

I'd be comfortable doing what syn and proc-macro2 do, adding support for new features from build.rs if run on a new-enough rustc version (synstructure tries to match syn's version guarantees, so supports back to rust 1.31), but I'd like to avoid breaking downstream crates.

What would work best for your use-case?

A non-breaking bump including a new opt-in boolean setting to do that seems ok to me.