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

Add support for reexporting the derive proc macro? #49

Closed
LHolten opened this issue Aug 31, 2024 · 2 comments
Closed

Add support for reexporting the derive proc macro? #49

LHolten opened this issue Aug 31, 2024 · 2 comments

Comments

@LHolten
Copy link

LHolten commented Aug 31, 2024

Hi, my library has a proc macro that generates code that uses #[derive(::my_library::RefCast)].
Here ::my_library::RefCast reexports ::ref_cast::RefCast, but sadly the RefCast macro generates hardcoded references to the ::ref_cast crate.
This means that users of my_library have to add a dependency on both my-library and ref-cast.

Could you make the RefCast derive macro accept a path to the location where it has been reexported from and then use that for the generated code?

@LHolten
Copy link
Author

LHolten commented Aug 31, 2024

Oh and I can make a PR if that is desired.

@dtolnay
Copy link
Owner

dtolnay commented Aug 31, 2024

I would prefer not to support that in this crate. But if you are interested in working on it, rust-lang/rust#54363 (comment) describes a design for how I would like for proc macro re-exporting to work instead.

@dtolnay dtolnay closed this as completed Aug 31, 2024
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

No branches or pull requests

2 participants