Skip to content

Commit 30aad29

Browse files
committed
Auto merge of #138363 - beetrees:f16-f128-integer-convert, r=Amanieu
Add `From<{integer}>` for `f16`/`f128` impls This PR adds `impl From<{bool,i8,u8}> for f16` and `impl From<{bool,i8,u8,i16,u16,i32,u32}> for f128`. The `From<{i64,u64}> for f128` impls are left commented out as adding them would allow using `f128` on stable before it is stabilised like in the following example: ```rust fn f<T: From<u64>>(x: T) -> T { x } fn main() { let x = f(1.0); // the type of the literal is inferred to be `f128` } ``` None of the impls added in this PR have this issue as they are all, at minimum, also implemented by `f64`. This PR will need a crater run for the `From<{i32,u32}>` impls, as `f64` is no longer the only float type to implement them (similar to the cause of #125198). cc `@bjoernager` r? `@tgross35` Tracking issue: #116909
2 parents c5a29ea + eb2cfab commit 30aad29

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)