From 67c68ab3a885a68ad971a7cad6603f408b3a1697 Mon Sep 17 00:00:00 2001 From: 1Kill2Steal <171241044+1Git2Clone@users.noreply.github.com> Date: Sun, 17 Nov 2024 15:02:04 +0200 Subject: [PATCH] Changed bit shift logic + added more CI logging --- .github/workflows/ci.yml | 2 +- src/utils/gcd.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a096128..8abe25b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,6 @@ jobs: - name: hw1-test-1 run: cargo test --verbose --features hw1-test-1 - name: hw1-test-2 - run: RUST_BACKTRACE=1 cargo test --verbose --features hw1-test-2 + run: RUSTFLAGS="-C overflow-checks=on" RUST_BACKTRACE=full cargo test --verbose --features hw1-test-2 - name: hw1-test-3 run: cargo test --verbose --features hw1-test-3 diff --git a/src/utils/gcd.rs b/src/utils/gcd.rs index 50cd0ba..034f854 100644 --- a/src/utils/gcd.rs +++ b/src/utils/gcd.rs @@ -7,7 +7,7 @@ use num_traits::PrimInt; pub trait Gcd where - Self: PrimInt + ShrAssign + SubAssign, + Self: PrimInt + ShrAssign + SubAssign, { /// NOTE: Exists for the internal LCM implementation. #[deprecated(note = "use crate::utils::gcd::Gcd::gcd() instead.")] @@ -24,7 +24,7 @@ where swap(&mut self, &mut other) } other -= self; - other >>= other.trailing_zeros(); + other >>= other.trailing_zeros() as usize; } self << k