From 55100e907eb2ff450b0370267cf10de0d7e5b4ee Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Thu, 11 Apr 2024 14:57:10 +0000 Subject: [PATCH 1/3] Remove unused cargo-platform dependency --- Cargo.lock | 1 - src/tools/tidy/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1bdaef81ff83..86032a68ccd0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5580,7 +5580,6 @@ dependencies = [ name = "tidy" version = "0.1.0" dependencies = [ - "cargo-platform", "cargo_metadata 0.15.4", "ignore", "lazy_static", diff --git a/src/tools/tidy/Cargo.toml b/src/tools/tidy/Cargo.toml index 8c6b1eb22ecbb..58302b8e63b19 100644 --- a/src/tools/tidy/Cargo.toml +++ b/src/tools/tidy/Cargo.toml @@ -6,7 +6,6 @@ autobins = false [dependencies] cargo_metadata = "0.15" -cargo-platform = "0.1.2" regex = "1" miropt-test-tools = { path = "../miropt-test-tools" } lazy_static = "1" From 9bcc98818c9b59dd0106aed95c4349c2c8ecdc48 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 11 Apr 2024 18:01:26 -0400 Subject: [PATCH 2/3] Remove `From` impls for unstable types that break inference Adding additional `From` implementations that fit `f32::from()` broke inference. Remove these for now. Fixes: --- library/core/src/convert/num.rs | 4 ++-- tests/ui/inference/untyped-primitives.rs | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/ui/inference/untyped-primitives.rs diff --git a/library/core/src/convert/num.rs b/library/core/src/convert/num.rs index 1737c631f0bd0..935ead2699a64 100644 --- a/library/core/src/convert/num.rs +++ b/library/core/src/convert/num.rs @@ -165,8 +165,8 @@ impl_from!(u16 => f64, #[stable(feature = "lossless_float_conv", since = "1.6.0" 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 +// 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")]); diff --git a/tests/ui/inference/untyped-primitives.rs b/tests/ui/inference/untyped-primitives.rs new file mode 100644 index 0000000000000..8515ca79903fc --- /dev/null +++ b/tests/ui/inference/untyped-primitives.rs @@ -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); +} From 41ac5d93d6c9d8bb3977e84f0926b9cfd08843b6 Mon Sep 17 00:00:00 2001 From: Yuanzhuo Yang <89326662+ShockYoungCHN@users.noreply.github.com> Date: Fri, 12 Apr 2024 01:28:58 -0500 Subject: [PATCH 3/3] fix pin.rs typo correct "implemts" to "implements" --- library/core/src/pin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs index c18dbafff160a..efd525aeb3b74 100644 --- a/library/core/src/pin.rs +++ b/library/core/src/pin.rs @@ -1198,7 +1198,7 @@ impl> Pin { /// Unwraps this `Pin`, returning the underlying pointer. /// /// Doing this operation safely requires that the data pointed at by this pinning pointer - /// implemts [`Unpin`] so that we can ignore the pinning invariants when unwrapping it. + /// implements [`Unpin`] so that we can ignore the pinning invariants when unwrapping it. /// /// # Examples ///