rust/library/std/tests/floats
bors c3dd4eefd6 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
2025-03-17 00:33:36 +00:00
..
f16.rs Auto merge of #138363 - beetrees:f16-f128-integer-convert, r=Amanieu 2025-03-17 00:33:36 +00:00
f32.rs Move std float unit tests to integration tests 2025-01-26 10:28:04 +00:00
f64.rs Move std float unit tests to integration tests 2025-01-26 10:28:04 +00:00
f128.rs Add From<{integer}> for f16/f128 impls 2025-03-11 18:58:54 +00:00
lib.rs Remove stabilized feature gate 2025-02-02 18:28:08 +00:00