I implemented proc macro and I want to avoid importing it everywhere I want to use it within #[derive(...)]. So I declared it in main.rs using extern crate packet. But I still need to import it directly.
On the other hand (or maybe additionally), it might also be sufficiently convenient to re-export (pub use packed::Packed) the derive macro in the same module where the trait is defined, assuming this is about a trait named Packed. (If it isn’t, then this remark does not apply.) Then the derive-macro will be usable unqualified whenever the trait is in scope, too.[1] This assumes that the crate that defines Packed does (at least conditionally, e.g. with a “derive” feature flag) depend on the crate that defines the proc-macro.
For context, macros and other items like functions or types can be in scope or even exported at the same time under the same name without conflict, and a like use crate_name::Packet statement would then bring both into scope at the same time. ↩︎