-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Macros are not propagated through pub extern crate
.
#51530
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
Comments
I'm also nominating for compiler team discussion -- this feels like it might be somewhat related to recent movement on the use extern macros feature? |
Here's a minimal reproduction case |
This is tagged as a regression, but did this ever work? Maybe my memory is faulty, but I didn't think that |
Put another way, the behavior @Xaeroxe describes is the behavior I expect. I think that this was the purpose of |
triage: P-high Marking as P-high so that we revisit next week. But I'm not convinced this is a bug (as I wrote earlier). Thoughts @rust-lang/compiler ? |
Yes, this isn't supposed to work. |
Closing as not a bug, thanks @petrochenkov. |
I'm trying to use this feature and it doesn't work with My use case is caused by the lack of workspace-wide dependency config in Cargo.toml, so I made a crate "deps" that was meant to reexport dependencies that need special feature flags or versions. It works fine, except for macros. I tried |
@MightyPork |
here is a minimal reproduction (tested with current stable): |
@MightyPork |
As of Rust 1.26.2 stable if I define an exported macro in crate
foo
thenpub extern crate foo
in another cratebar
then consumers of thebar
crate cannot use the macro infoo
even if there is a#[macro_use]
on thepub extern crate foo
and a#[macro_use]
on theextern crate bar
in the consumers code.I would expect the macros to be propagated similarly to the other items in the
foo
crate.This can be worked around by having the consumer of
bar
depend onfoo
directly, but that defeats the purpose of thepub extern crate
imo.The text was updated successfully, but these errors were encountered: