Closed jean-airoldie closed 4 years ago
A better solution would be to provide a proc_macro
helper attribute that allows the user to specify an explicit import identifier. If no such helper if present, the proc_macro would default to the current behavior.
Since the proc_macro implementation explicity declares an
extern num_traits
crate, any crate that wants to use it must also depend onnum-traits
.https://github.com/rust-num/num-derive/blob/1b361d7af828467aa9a1d80d609793f0a312aae5/src/lib.rs#L80
This can be a problem in case a crate reexport a
num-derive
proc macros because it forces the user to also depend onnum-traits
otherwise it produces:error[E0463]: can't find crate for
_num_traits`.Would it be possible to add a feature flag that disable this behavior? Specifically it would be the user's responsability to make sure that the
num-traits
crate is in scope.