Conversation
src/uint.rs
Outdated
| (U8192, 8192, "8192-bit") | ||
| } | ||
|
|
||
| #[cfg(not(feature = "extra-sizes"))] |
There was a problem hiding this comment.
Instead of having a not, extra-sizes could be purely additive.
That would also take care of the doc_auto_cfg documentation, so the extra sizes are appropriately tagged as needing the feature.
There was a problem hiding this comment.
Problem is, the original set of supported sizes is large and looks abit "random" IMO. If, e.g., we'd have U64, U128, U256, U512, U1024, U2048, U4096, U8192 as the types supported by default and everything else requiring extra_sizes, this would make sense. However, I don't think we can do that can we? (I'm not sure if feature-gating a non-feature gated type is considered a break of SemVer or not)
Otherwise, with the way things are currently, this becomes a little grotesque. However, if you'd still prefer that, I'll make the change. Remember however, that these distinctions will become harder with the extra_trait_impls macros.
There was a problem hiding this comment.
(Your suggestion was my original line of thought and I chose against it because of the aforementioned reasoning)
There was a problem hiding this comment.
I think one way or another the types which require a feature need to be annotated with the feature name in the rustdoc.
If you simply define them in a module which is feature-gated, doc_auto_cfg should take care of that automatically.
There was a problem hiding this comment.
Can I keep only U64, U128, U256, U512, U1024, U2048, U4096, U8192 outside the feature-gate, or should I stick with the current set?
There was a problem hiding this comment.
No, that would be a breaking change, and other sizes are used by published crates
tarcieri
left a comment
There was a problem hiding this comment.
Looks better now, thanks.
Still a lot in uint.rs, and I'm not sure the feature-gated sizes will be properly reflected in the rustdoc, but I can try fixing that in a followup.
Thanks! |
Resolves #228