From 6b32b86fceaa662ac615acce49d8e5b2a600d4bf Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 11 Jul 2024 14:33:23 -0700 Subject: [PATCH 1/3] Update toolchain to 1.79 stable --- Cargo.toml | 1 + src/in_range.rs | 2 ++ src/internal.rs | 1 + src/levels.rs | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 25d50ccec..3cbfa5862 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ authors = ["C2Rust"] version = "0.2.0" publish = false edition = "2021" +rust-version = "1.79" [lib] path = "lib.rs" diff --git a/src/in_range.rs b/src/in_range.rs index 7d007813b..248fd8e02 100644 --- a/src/in_range.rs +++ b/src/in_range.rs @@ -71,11 +71,13 @@ macro_rules! impl_const_new { } impl InRange<$T, MIN, MAX> { + #[allow(unused)] pub const fn const_new(value: $T) -> Self { assert!(value as u128 >= MIN && value as u128 <= MAX); Self(value) } + #[allow(unused)] pub const fn new_array(a: [$T; N]) -> [Self; N] { let mut b = [DefaultValue::DEFAULT; N]; const_for!(i in 0..N => { diff --git a/src/internal.rs b/src/internal.rs index f8ed40fc5..7c864988c 100644 --- a/src/internal.rs +++ b/src/internal.rs @@ -941,6 +941,7 @@ pub const CF_LEN: usize = 32 * 32; pub struct Cf([i32; CF_LEN]); impl Cf { + #[allow(unused)] pub fn select(&self) -> &[BD::Coef; CF_LEN] { FromBytes::ref_from_prefix(AsBytes::as_bytes(&self.0)).unwrap() } diff --git a/src/levels.rs b/src/levels.rs index 1b0b48175..18a7ef57c 100644 --- a/src/levels.rs +++ b/src/levels.rs @@ -55,7 +55,7 @@ pub enum TxfmSize { impl TxfmSize { pub const NUM_SQUARE: usize = Self::S64x64 as usize + 1; - pub const NUM_RECT: usize = Self::COUNT; + pub const _NUM_RECT: usize = Self::COUNT; } impl DefaultValue for TxfmSize { From 49e46bb8a24d8cd70162bfafe7ba999940a5b78b Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Fri, 12 Jul 2024 11:41:20 -0700 Subject: [PATCH 2/3] Switch x86 builds in CI to stable toolchain --- .github/workflows/build-and-benchmark-x86.yml | 2 +- .github/workflows/build-and-test-x86-extra.yml | 4 ++-- .github/workflows/build-and-test-x86.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-benchmark-x86.yml b/.github/workflows/build-and-benchmark-x86.yml index 34dda02b5..865e05894 100644 --- a/.github/workflows/build-and-benchmark-x86.yml +++ b/.github/workflows/build-and-benchmark-x86.yml @@ -15,7 +15,7 @@ jobs: - name: release build main branch run: | git fetch --depth 1 origin main && git checkout origin/main - nice cargo build --release --target-dir target.main + nice cargo +stable build --release --target-dir target.main - name: benchmark on chimera 8-bit test data run: | mkdir -p `dirname $LOCAL_FILE` diff --git a/.github/workflows/build-and-test-x86-extra.yml b/.github/workflows/build-and-test-x86-extra.yml index 8dcf2be13..d7f02ea00 100644 --- a/.github/workflows/build-and-test-x86-extra.yml +++ b/.github/workflows/build-and-test-x86-extra.yml @@ -60,8 +60,8 @@ jobs: argon_coveragetool_av1_base_and_extended_profiles_v2.1.1.zip - name: cargo build for ${{ matrix.target }} ${{ matrix.build.name }} run: | - rustup target add ${{ matrix.target }} - cargo build --target ${{ matrix.target }} ${{ matrix.build.flags }} + rustup target add --toolchain stable ${{ matrix.target }} + cargo +stable build --target ${{ matrix.target }} ${{ matrix.build.flags }} env: RUSTFLAGS: "-C overflow-checks=on" - name: download, check, and unpack argon test vectors diff --git a/.github/workflows/build-and-test-x86.yml b/.github/workflows/build-and-test-x86.yml index 3bd8b8e9f..08e41a1c1 100644 --- a/.github/workflows/build-and-test-x86.yml +++ b/.github/workflows/build-and-test-x86.yml @@ -57,8 +57,8 @@ jobs: - name: cargo build for ${{ matrix.target }} ${{ matrix.build.name }} run: | cargo clean - rustup target add ${{ matrix.target }} - cargo build --target ${{ matrix.target }} ${{ matrix.build.flags }} + rustup target add --toolchain stable ${{ matrix.target }} + cargo +stable build --target ${{ matrix.target }} ${{ matrix.build.flags }} - name: meson test for ${{ matrix.target }} ${{ matrix.build.name }} run: | .github/workflows/test.sh \ @@ -110,7 +110,7 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: cargo build for x86_64-apple-darwin run: | - cargo build --release + cargo +stable build --release - name: meson test for x86_64-apple-darwin run: | .github/workflows/test.sh \ From 3d4223ac4f2229f9672cf75bf178af28e0027085 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Fri, 12 Jul 2024 11:44:51 -0700 Subject: [PATCH 3/3] Switch aarch64 builds in CI to stable toolchain --- .github/workflows/build-and-test-aarch64-android.yml | 4 ++-- .github/workflows/build-and-test-aarch64-darwin.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test-aarch64-android.yml b/.github/workflows/build-and-test-aarch64-android.yml index ccfb3dd4b..feccc1942 100644 --- a/.github/workflows/build-and-test-aarch64-android.yml +++ b/.github/workflows/build-and-test-aarch64-android.yml @@ -29,8 +29,8 @@ jobs: key: aarch64-android-cargo-and-target-${{ hashFiles('**/Cargo.lock') }} - name: cargo build for aarch64-linux-android run: | - rustup target add aarch64-linux-android - cargo build --target aarch64-linux-android --release + rustup target add --toolchain stable aarch64-linux-android + cargo +stable build --target aarch64-linux-android --release env: AR: llvm-ar CC: aarch64-linux-android26-clang diff --git a/.github/workflows/build-and-test-aarch64-darwin.yml b/.github/workflows/build-and-test-aarch64-darwin.yml index 0f77c98ec..b341c5ad3 100644 --- a/.github/workflows/build-and-test-aarch64-darwin.yml +++ b/.github/workflows/build-and-test-aarch64-darwin.yml @@ -34,7 +34,7 @@ jobs: target/ key: arm-darwin-cargo-and-target-${{ hashFiles('**/Cargo.lock') }} - name: cargo ${{ matrix.build.name }} build for aarch64-apple-darwin - run: cargo build ${{ matrix.build.cargo_flags }} + run: cargo +stable build ${{ matrix.build.cargo_flags }} - name: test ${{ matrix.build.name }} build without frame delay run: | .github/workflows/test.sh \