-
Notifications
You must be signed in to change notification settings - Fork 653
Cannot use macros when crate is renamed #2099
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
This is known, but in general there's no way to solve this for procedural macros (at least that I know of). @dtolnay may know if there have been any recent innovations here? |
@cramertj This crate claims to solve this problem, but I have not tried it myself - https://crates.io/crates/proc-macro-crate |
I definitely do not recommend using proc-macro-crate. It's based on parsing a Cargo.toml at macro expansion time so it breaks non-Cargo builds. I think this is possible to make work correctly but I don't know if anyone has done it yet. Conceivably the |
@dtolnay I believe I tried that in the past and found that |
I think this probably works, but I found a way to support not only rename but also reexport, so I filed #2124. EDIT: this seems to work after rust-lang/rust#57155 |
When the
futures
crate is renamed:Macros like
try_join
cannot find the crate.Eg:
fails with
This impedes migration from version 0.1 to version 0.3, since one of the two futures crates must be renamed.
The text was updated successfully, but these errors were encountered: