-
Notifications
You must be signed in to change notification settings - Fork 52
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
Split the proc macro to dependency crate #31
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
TypedBuidler
custom derive proc macro generates some helpers. In current master there are{BuilderType}_Optional
and{BuilderType}_core
, and #30 is adding some bottom types ({BuilderType}_Error_Missing_required_field_{field_name}
and{BuilderType}_Error_Repeated_field_{field_name}
)These things are weirdly mangled and repeated for every struct with a typed builder even though they are exactly the same - it would be better if we could just put them in the typed builder crate, with legal Rust names, and just reuse them. The problem is that proc macro crates are not allowed to export anything that's not a proc macro.
The solution: split the proc macro to a new crate - say
typed-builder-procmacro
- and havetyped-builder
re-export it. This is the common solution for this problem in Rust-2018 where macros can be imported/exported like regular symbols.The text was updated successfully, but these errors were encountered: