-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add num_traits
proc_macro helper for explicit import
#35
Conversation
1142f8d
to
6cec260
Compare
num_traits
proc_macro helper for explicit importnum_traits
proc_macro helper for explicit import
8b1b65c
to
5283f57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks nice, thank you.
One request though -- I think we need a test where num-traits
is really not a direct dependency. The panini
test is a start, but the real num-traits
will still be in the crate prelude, so we don't really know that it did the right thing. Maybe you could add another test crate like the check/
path (used for no-std), and in this case depend on the num
crate with #[num_traits = "num"]
.
Also I was wondering about the format of the helper attribute. We could also use an helper a la serde: |
5283f57
to
114944a
Compare
The `num-derive` requires `num-traits` to be explicitly included in Cargo.toml. (cf. rust-num/num-derive#34) This issue may be fixed in rust-num/num-derive#35.
This allows the user to specify a identifier for the `num_traits` crate so that the proc_macro can directly depend in it. This is usefull when reexporting `num-derive` and using `num-trait` as a transitive import. Fixes rust-num#34.
Hi, sorry I forgot to finish review on this. I went ahead and tinkered with it myself a bit more, and I think this is good to go. Thanks again! bors r+ |
Build succeeded: |
This allows the user to specify a identifier for the
num_traits
crateso that the proc_macros can directly depend in it.
This is usefull when reexporting
num-derive
and usingnum-trait
asa transitive import.
Fixes #34.
CC. @vglavnyy