From 70b127248a132e4cd437e740f5dd465f45450621 Mon Sep 17 00:00:00 2001 From: "Stefan J. Wernli" Date: Wed, 17 Jan 2024 08:13:29 -0800 Subject: [PATCH] Update to Rust 1.75, fix clippy lints (#1021) This change updates the minimum version of Rust supported for local dev and used in the pipelines to 1.75. It also fixes one remaining clippy lint that is new to 1.75. --- .ado/publish.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/publish-playground.yml | 2 +- compiler/qsc_fir/src/fir.rs | 9 +++++++++ prereqs.py | 6 +++--- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.ado/publish.yml b/.ado/publish.yml index a908b996d7..7b213815f3 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -5,7 +5,7 @@ pr: none variables: CARGO_TERM_COLOR: always - RUST_TOOLCHAIN_VERSION: "1.73" + RUST_TOOLCHAIN_VERSION: "1.75" # variables set by pipeline # - BASE_IMAGE diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12156e60bd..7a28dfcdca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ env: CARGO_TERM_COLOR: always NODE_VERSION: "18.17.1" PYTHON_VERSION: "3.11" - RUST_TOOLCHAIN_VERSION: "1.73" + RUST_TOOLCHAIN_VERSION: "1.75" RUST_TOOLCHAIN_COMPONENTS: rustfmt clippy jobs: diff --git a/.github/workflows/publish-playground.yml b/.github/workflows/publish-playground.yml index 4e5d6d986d..9e75749877 100644 --- a/.github/workflows/publish-playground.yml +++ b/.github/workflows/publish-playground.yml @@ -11,7 +11,7 @@ on: env: CARGO_TERM_COLOR: always - RUST_TOOLCHAIN_VERSION: "1.73" + RUST_TOOLCHAIN_VERSION: "1.75" RUST_TOOLCHAIN_COMPONENTS: rustfmt clippy # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages diff --git a/compiler/qsc_fir/src/fir.rs b/compiler/qsc_fir/src/fir.rs index 4390dc1ade..c3b721d770 100644 --- a/compiler/qsc_fir/src/fir.rs +++ b/compiler/qsc_fir/src/fir.rs @@ -521,6 +521,15 @@ impl PackageStore { } } +impl<'a> IntoIterator for &'a PackageStore { + type IntoIter = qsc_data_structures::index_map::Iter<'a, PackageId, Package>; + type Item = (PackageId, &'a Package); + + fn into_iter(self) -> Self::IntoIter { + self.iter() + } +} + /// A trait to find elements in a package. pub trait PackageLookup { /// Gets a block. diff --git a/prereqs.py b/prereqs.py index 0eee7fc0fd..c7f101e64a 100755 --- a/prereqs.py +++ b/prereqs.py @@ -13,14 +13,14 @@ import functools python_ver = (3, 11) # Python support for Windows on ARM64 requires v3.11 or later -rust_ver = (1, 73) # Ensure Rust version 1.73 or later is installed +rust_ver = (1, 75) # Ensure Rust version 1.75 or later is installed node_ver = ( 18, 17, ) wasmpack_ver = (0, 12, 1) # Latest tested wasm-pack version -rust_fmt_ver = (1, 6, 0) # Current version when Rust 1.73 shipped -clippy_ver = (0, 1, 69) +rust_fmt_ver = (1, 7, 0) # Current version when Rust 1.75 shipped +clippy_ver = (0, 1, 75) # Disable buffered output so that the log statements and subprocess output get interleaved in proper order print = functools.partial(print, flush=True)