When cross-compiling and depending on a Cargo-renamed pure proc-macro crate a rustc bug can sometimes be triggered which errors in unresolved imports.
In the case of ::macro_rules_attribute, the bug amounted to the following errors:
error[E0432]: unresolved imports `proc_macro::macro_rules_attribute`, `proc_macro::macro_rules_derive`
|
8 | macro_rules_attribute,
| ^^^^^^^^^^^^^^^^^^^^^ no `macro_rules_attribute` in the root
9 | macro_rules_derive,
| ^^^^^^^^^^^^^^^^^^ no `macro_rules_derive` in the root
Solution
Undo the renaming at the Cargo.toml layer and instead use the full name in src/lib.rs. This is unfortunate, but the change is at least contained entirely within the crate.
I've confirmed with a Cargo patch that undoing these renames avoids triggering the rustc bug when cross-compiling.
Problem
When cross-compiling and depending on a Cargo-renamed pure proc-macro crate a rustc bug can sometimes be triggered which errors in unresolved imports.
In the case of
::macro_rules_attribute
, the bug amounted to the following errors:Solution
Undo the renaming at the
Cargo.toml
layer and instead use the full name insrc/lib.rs
. This is unfortunate, but the change is at least contained entirely within the crate.I've confirmed with a Cargo patch that undoing these renames avoids triggering the rustc bug when cross-compiling.