-
Notifications
You must be signed in to change notification settings - Fork 49
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
Macro reexporting broken in 0.1.24 & 0.1.25 #241
Comments
Looks like this can be done with proc macros, as of 2019 (last time I looked was a good while before that)! The |
@bearcage Damn, thanks for this catch. Let me see what I can do. |
No sweat -- PR incoming! |
or it will be if I can sort out how exactly that feature's meant to work anyhow |
@bearcage Excellent. If you get it, let me know. The alternative is that we can just pass the whole |
Ok, as far as I can tell that feature unfortunately seems to only work for referring to not-macro things out of |
Fixed in 0.1.26 🤞 - I don't see why this solution would't work but please re-open if it doesn't! Thanks for the report. |
That does the job for me, thanks much! |
The changes from this diff and released in 0.1.24 and the subsequent 0.1.25 (which, incidentally, looks to be available on crates.io but not reflected in the commit history pushed to github for
ctor/Cargo.toml
) refer toctor
as a top level module in the macro callsites which deduplicated the big cfg_attr blocks. This, unfortunately, results in errors that look like the attached screenshot if you have reexported the ctor attribute macro in a crate of your own.Specifically, this happens because crates which depend on ctor by another name, or only transitively (as in my use case) will not have
::ctor
available. The usual workaround for this of reexporting dependency macros from your own crate (::config::premain_support::ctor
in my case) doesn't work if the reexported macro generates references to itself by name. For not-so-procedural macros,$crate
is available to work around this. There might be a general answer for this for procedural macros, but I'm not aware of one -- I'll take a quick look and see what I can find, though.The text was updated successfully, but these errors were encountered: