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

Export proc-macros directly from main crate #71

Closed
TedDriggs opened this Issue Nov 22, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@TedDriggs
Copy link

TedDriggs commented Nov 22, 2017

There's a trick that can export traits and proc macros from one crate. Using this would make the dependency declaration cleaner, and could be gated on a default feature for people who don't need the macros.

@withoutboats

This comment has been minimized.

Copy link
Collaborator

withoutboats commented Nov 25, 2017

Can you link to the trick?

@TedDriggs

This comment has been minimized.

Copy link

TedDriggs commented Nov 27, 2017

Here is @dtolnay's awesome writeup on it.

You can see it in action here in one of my own projects.

I believe the trick is that you can reexport proc macros, you just can't declare them locally.

@withoutboats

This comment has been minimized.

Copy link
Collaborator

withoutboats commented Nov 27, 2017

Interesting! This is technically an unstable feature we accidentally allowed through on stable. I'll think about doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment