Skip to content
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

Allow the use of const _ instead of generating names #41

Closed
nox opened this issue May 1, 2020 · 2 comments · Fixed by #43
Closed

Allow the use of const _ instead of generating names #41

nox opened this issue May 1, 2020 · 2 comments · Fixed by #43

Comments

@nox
Copy link
Contributor

nox commented May 1, 2020

This was stabilised a year ago.

@nox nox changed the title Allow the use of const _ instead of generating a name for it Allow the use of const _ instead of generating names May 1, 2020
@mystor
Copy link
Owner

mystor commented May 16, 2020

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?

@nox
Copy link
Contributor Author

nox commented May 16, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants