-   Notifications  You must be signed in to change notification settings 
- Fork 13.9k
Open
Labels
F-f16_and_f128`#![feature(f16)]`, `#![feature(f128)]``#![feature(f16)]`, `#![feature(f128)]`T-langRelevant to the language teamRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Adding a From<f16> for f32 impl breaks some inference that currently works. From #123824:
fn main() { let x = f32::from(3.14); }The new float types are a long way from being stable, but it may be good to decide how to handle things if we would like this implementation one day. Per @fmease at #123824 (comment), there are three options:
- Accept this regression since technically, no stable API is broken
- Say that we do not want From<f16> for f32
- Make this implementation available starting with the new edition
I'll mark this with the edition label so it can at least come into consideration, but this is the lowest priority thing on any list.
Known failure points from adding this directly:
- Fuchsia: https://cs.opensource.google/fuchsia/fuchsia/+/main:src/recovery/lib/recovery-ui/src/keyboard.rs;l=111;drc=e1ed8a47e77b0ea1d6f83b93830c4e975a8a6089 (from Type inference failure for f32#123824 (comment))
- taffy: https://github.com/DioxusLabs/taffy/blob/f1e4edab96ee13f7d1fbc2536ac31633b0e620d6/src/style_helpers.rs#L58 (from Type inference failure for- f32#123824 (comment))
- contour-rs: https://github.com/mthh/contour-rs/blob/08c1d83a1461aa19543ed402d23908eb55234fd1/src/lib.rs#L488-L491 (from Fix overflow when using large raster sizes mthh/contour-rs#13 (comment))
- Bevy: f32::from(<untyped float>)inference withf16andf128#123831 (comment)
- egui: the trait bound f32: From<f64> is not satisfiederror on nightly emilk/egui#4352
@rustbot label +T-lang +T-libs +A-edition-2024 +F-f16_and_f128
Metadata
Metadata
Assignees
Labels
F-f16_and_f128`#![feature(f16)]`, `#![feature(f128)]``#![feature(f16)]`, `#![feature(f128)]`T-langRelevant to the language teamRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.