pid-rs
pid-rs copied to clipboard
SemVer may have been broken between 4.0.0 and 4.1.0 release
Hello,
I was recently compiled a project with pid = "4" in the Cargo.toml file for the first time in a few weeks, and experienced failed compile. This appears to line up with the timeline for the release of this library's 4.1 release. Upon specifying pid = "=4.0" in my Cargo.toml file, the compilation error was fixed. The error I received was
error[E0277]: the trait bound `T: num_traits::Signed` is not satisfied
--> src/controller.rs:22:19
|
22 | pub internal: pid::Pid<T>,
| ^^^^^^^^^^^ the trait `num_traits::Signed` is not implemented for `T`
|
= note: required for `T` to implement `pid::Number`
note: required by a bound in `pid::Pid`
--> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/pid-4.1.0/src/lib.rs:107:19
|
107 | pub struct Pid<T: Number> {
| ^^^^^^ required by this bound in `Pid`
help: consider further restricting type parameter `T` with trait `Signed`
|
19 | pub struct Pid<A: Axis, T: FloatCore + num_traits::Signed> {
| ++++++++++++++++++++
This leads me to believe that SemVer may have accidentally been broken during a minor version release and just wanted to report that possibility.
This was compiled with rustc 1.86.0-nightly (824759493 2025-01-09) on Ubuntu 22.04. If you'd like any add'l information, just let me know. Thank you!
Yanked, I'll see tomorrow. This shouldn't have been breaking 😔
I've done some quick debugging tonight and it appears it breaks for unsigned ints (e.g., u8 or usize) which wheren't originally tested for. It might also break custom types which implemented FloatCore but not Signed. Definately deserves a yank on my behalf, thanks for the report!
What type are you using for this so I can add a new test for it whilst fixing for a v5.0.0 release?
I believe that I wrapped the Pid in a struct that takes T: num_traits::float::FloatCore, but the concrete implementation is currently for f32 (with an eye on probably moving towards f64 at some point).