-
Notifications
You must be signed in to change notification settings - Fork 13k
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
decl_macro: imports don't work in cross-crate invocations #42337
Comments
Sorry for the delay getting to this. Fixed in #46419. |
I don't know if it is the same issue (and if the PR fixed it), but I get the same error with
Is there any workaround for this issue? |
Record all imports (`use`, `extern crate`) in the crate metadata This PR adds non-`pub` `use` and `extern crate` imports in the crate metadata since hygienic macros invoked in other crates may use them. We already include all other non-`pub` items in the crate metadata. This improves import suggestions in some cases. Fixes #42337. r? @nrc
@antoyo This is a consequence of hygiene. Since There is no The solution here is to add target dependencies to proc-macro crates as described in #45934 (comment). For now, you need to put an
Alternatively, you can make |
Minimal reproduction:
Invoking the macro in the same crate as it's defined works as expected.
cc @jseyfried
The text was updated successfully, but these errors were encountered: