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. Fixes: <https://github.com/rust-lang/rust/issues/123824>
This commit is contained in:
parent
aa6a697a1c
commit
9bcc98818c
@ -165,8 +165,8 @@ fn from(small: $Small) -> Self {
|
||||
impl_from!(u32 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
|
||||
|
||||
// float -> float
|
||||
impl_from!(f16 => f32, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
|
||||
impl_from!(f16 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
|
||||
// FIXME(f16_f128): adding additional `From` impls for existing types breaks inference. See
|
||||
// <https://github.com/rust-lang/rust/issues/123824>
|
||||
impl_from!(f16 => f128, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
|
||||
impl_from!(f32 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
|
||||
impl_from!(f32 => f128, #[stable(feature = "lossless_float_conv", since = "1.6.0")]);
|
||||
|
9
tests/ui/inference/untyped-primitives.rs
Normal file
9
tests/ui/inference/untyped-primitives.rs
Normal file
@ -0,0 +1,9 @@
|
||||
//@ check-pass
|
||||
// issue: rust-lang/rust#123824
|
||||
// This test is a sanity check and does not enforce any stable API, so may be
|
||||
// removed at a future point.
|
||||
|
||||
fn main() {
|
||||
let x = f32::from(3.14);
|
||||
let y = f64::from(3.14);
|
||||
}
|
Loading…
Reference in New Issue
Block a user