num-traits: Tracking issue for potential breaking changes

num-traits is somewhat of a de facto stable crate. Since these traits are often found in the public API of other crates, we really want to avoid the sort of ecosystem split that a breaking-change semver bump might cause.

Nevertheless, it’s a good idea to track what breaking changes we might want to make someday, now found in the list below. Links are included to postponed issues, which often have more details. They will be closed in the meantime, but discussion can continue.

  • Remove default epsilon implementation for Float #4
  • Num::FromStrRadixErr should have Trait bound #6
  • More features for Float #8
  • All bit twiddling functions in num::traits::PrimInt should take or return usize instead of u32 #14
  • std::num::Checked{Add,Sub,Mul,Div} should have type parameters #15
  • Use Mul by reference in pow #18
  • Make the Float trait depend on FloatConst. #20
  • Add Default, Display, and Debug trait bounds to PrimInt #44
  • Easy conversions between Signed and Unsigned #46
  • Blanket impl for Real trait prevents parameterized implementations. #49
  • Functions to distinguish signaling from non-signaling NaN’s #51
  • Bound FloatCore by Bounded? #55
  • Implement traits for Reverse (rust 1.19+) #65
  • Make One::is_one a required method and remove its Self: PartialEq https://github.com/rust-num/num-traits/issues/5#issuecomment-370271019
  • LowerBounded and UpperBounded (#210) should be super-traits of Bounded

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

The changes in this list would all be for a potential 2.0, but I don’t know if there’s a right time to do that. I fear it will be really painful. It also doesn’t help that I’m the only active maintainer here, and I don’t have much time for it – the refactors we all want would probably overwhelm me just to review…

It’s a lot of work growing a community! Thank you so much for all your contributions thus far, so much of the Rust community (and now for-profit companies) depend on your work and it’s going unappreciated.

What support and help can we give to help ship a new release with breaking changes? Which parts of releasing fill you with the most dread?

@cuviper The crate has known issues which can not be fixed without a breaking release. Personally, I would strongly prefer if first num-traits v0.3 with necessary changes was released first and only if it will require no breaking changes for a certain amount of time (e.g. one year), release it as v1.0 via semver trick.

Cutting a 1.0 release because you don’t have enough time to work on the crate is not a great practice in my opinion, especially for a core crate. Maybe you could attract additional maintainers via announcement on URLO/Reddit/etc?

@Elizafox yes, but even better put them in a separate crate so they can be versioned separately.

I was talking primarily about the NumCast trait. Probably deprecating it in favor of From/TryFrom should be considered as well.

I know I’m just a rando, but if I may make a suggestion, perhaps you could namespace breaking traits as a stopgap? It’s less maintainership burden, doesn’t involve the burden of supporting multiple releases, and solves the immediate problem.

maybe like num-traits::experimental:: etc. Once things there are stabilised, and you’re ready to release them, you can release them as the defaults in 0.3.x or whatever.