Skip to content

Commit 5ae3a55

Browse files
authored
Rollup merge of rust-lang#123830 - tgross35:f16-f128-from-inference-fix, r=Nilstrieb
Remove `From` impls for unstable types that break inference Adding additional `From` implementations that fit `f32::from(<unaffixed float>)` broke inference. Remove these for now. I added a test to make sure this doesn't quietly change in the future, even though the behavior is not technically guaranteed rust-lang#123824 (comment) Fixes: <rust-lang#123824>
2 parents df15a2a + 5a085ee commit 5ae3a55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/convert/num.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ 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-
impl_from!(f16 => f32, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
169-
impl_from!(f16 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
168+
// FIXME(f16_f128): adding additional `From` impls for existing types breaks inference. See
169+
// <https://github.com/rust-lang/rust/issues/123824>
170170
impl_from!(f16 => f128, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
171171
impl_from!(f32 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
172172
impl_from!(f32 => f128, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);

0 commit comments

Comments
 (0)