Skip to content

Commit 2d89cee

Browse files
committed
Auto merge of rust-lang#124728 - beetrees:from-f16-for-f64, r=BurntSushi
Re-add `From<f16> for f64` This impl was originally added in rust-lang#122470 before being removed in rust-lang#123830 due to rust-lang#123831. However, the issue only affects `f32` (which currently only has one `From<{float}>` impl, `From<f32>`) as `f64` already has two `From<{float}>` impls (`From<f32>` and `From<f64>`) and is also the float literal fallback type anyway. Therefore it is safe to re-add `From<f16> for f64`. This PR also updates the FIXME link to point to the open issue rust-lang#123831 rather than the closed issue rust-lang#123824. Tracking issue: rust-lang#116909 `@rustbot` label +F-f16_and_f128 +T-libs-api
2 parents 97bf25c + 5cc4ee3 commit 2d89cee

File tree

1 file changed

+3
-2
lines changed
  • library/core/src/convert

1 file changed

+3
-2
lines changed

library/core/src/convert/num.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,9 @@ impl_from!(u16 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0"
165165
impl_from!(u32 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
166166

167167
// float -> float
168-
// FIXME(f16_f128): adding additional `From` impls for existing types breaks inference. See
169-
// <https://github.com/rust-lang/rust/issues/123824>
168+
// FIXME(f16_f128): adding additional `From<{float}>` impls to `f32` breaks inference. See
169+
// <https://github.com/rust-lang/rust/issues/123831>
170+
impl_from!(f16 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
170171
impl_from!(f16 => f128, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
171172
impl_from!(f32 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
172173
impl_from!(f32 => f128, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);

0 commit comments

Comments
 (0)