Open
Description
There are probably some generic trait implementations that cause rustc to follow this line of reasoning.
use std::convert::TryFrom;
fn main() {
f64::try_from(4usize);
}
Errors:
Compiling playground v0.0.1 (/playground)
error[E0277]: the trait bound `f64: std::convert::From<usize>` is not satisfied
--> src/main.rs:4:5
|
4 | f64::try_from(4usize);
| ^^^^^^^^^^^^^ the trait `std::convert::From<usize>` is not implemented for `f64`
|
= help: the following implementations were found:
<f64 as std::convert::From<f32>>
<f64 as std::convert::From<i16>>
<f64 as std::convert::From<i32>>
<f64 as std::convert::From<i8>>
and 3 others
= note: required because of the requirements on the impl of `std::convert::Into<f64>` for `usize`
= note: required because of the requirements on the impl of `std::convert::TryFrom<usize>` for `f64`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.