I haven't managed to minimize this yet, but github+cargo makes it pretty easy to reproduce:
git clone -b i32-inference-problem-demo https://github.com/dekellum/http rustc --version cargo test cargo test --doc src/response.rs # more failures here
On our MSRV 1.39.0 and recent nightly as shown:
rustc 1.49.0-nightly (1773f60ea 2020-11-08) error[E0277]: the trait bound `http::StatusCode: From<i32>` is not satisfied --> tests/status_code.rs:30:15 | 30 | let max = StatusCode::try_from(999).unwrap(); | ^^^^^^^^^^^^^^^^^^^^ the trait `From<i32>` is not implemented for `http::StatusCode` | = help: the following implementations were found: <http::StatusCode as From<&'a http::StatusCode>> = note: required because of the requirements on the impl of `Into<http::StatusCode>` for `i32` = note: required because of the requirements on the impl of `TryFrom<i32>` for `http::StatusCode` = note: required by `try_from` error: aborting due to previous error
A workaround in tests/status_code.rs is to use 999u32. But why is that needed?
TryFrom<UT> for StatusCode and
From<StatusCode> for UT for UT over all signed types (
git revert d54d394).
More mysteriously, removing
From<StatusCode> for UT, UT over
u64 also avoids the issue? So adding only unsigned conversions can effectively be a breaking change to your public interface? See that change below:
Anyone else been bitten by this or can deduce the cause?