From 6c1c1e5a7af3223ae58a8b1bc6a1a3bcec3ca104 Mon Sep 17 00:00:00 2001 From: warren2k <846021+warren2k@users.noreply.github.com> Date: Sun, 30 Jul 2023 10:44:56 -0400 Subject: [PATCH 1/2] Disallow compile warnings in CI Co-authored-by: Shahar "Dawn" Or --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c412fc835..d90274ea4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - run: cargo check ${{ matrix.features }} + - run: RUSTFLAGS="--deny warnings" cargo check ${{ matrix.features }} msrv: runs-on: ubuntu-latest From 3419e5bb8fbee1329b69277e11558e398d32e8c9 Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Sat, 30 Sep 2023 21:59:47 +0700 Subject: [PATCH 2/2] build: resolve warnings Co-authored-by: warren2k <846021+warren2k@users.noreply.github.com> --- benches/fold_specialization.rs | 2 ++ benches/tree_fold1.rs | 2 ++ src/size_hint.rs | 1 + src/tuple_impl.rs | 2 +- tests/quick.rs | 2 ++ tests/specializations.rs | 2 ++ tests/test_core.rs | 1 + tests/test_std.rs | 2 ++ 8 files changed, 13 insertions(+), 1 deletion(-) diff --git a/benches/fold_specialization.rs b/benches/fold_specialization.rs index ef7f47c43..3a040305b 100644 --- a/benches/fold_specialization.rs +++ b/benches/fold_specialization.rs @@ -1,3 +1,5 @@ +#![allow(unstable_name_collisions)] + use criterion::{criterion_group, criterion_main, Criterion}; use itertools::Itertools; diff --git a/benches/tree_fold1.rs b/benches/tree_fold1.rs index 77af505f1..5b76d5404 100644 --- a/benches/tree_fold1.rs +++ b/benches/tree_fold1.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use criterion::{criterion_group, criterion_main, Criterion}; use itertools::{cloned, Itertools}; diff --git a/src/size_hint.rs b/src/size_hint.rs index 857e0c4c6..d592ca925 100644 --- a/src/size_hint.rs +++ b/src/size_hint.rs @@ -29,6 +29,7 @@ pub fn add_scalar(sh: SizeHint, x: usize) -> SizeHint { } /// Subtract `x` correctly from a `SizeHint`. +#[cfg(feature = "use_alloc")] #[inline] pub fn sub_scalar(sh: SizeHint, x: usize) -> SizeHint { let (mut low, mut hi) = sh; diff --git a/src/tuple_impl.rs b/src/tuple_impl.rs index c01190e98..c0b39d79d 100644 --- a/src/tuple_impl.rs +++ b/src/tuple_impl.rs @@ -111,7 +111,7 @@ where // not yet produced as a tuple. let buffered = T::buffer_len(&self.buf); // To that, we must add the size estimates of the underlying iterator. - let (mut unbuffered_lo, mut unbuffered_hi) = self.iter.size_hint(); + let (unbuffered_lo, unbuffered_hi) = self.iter.size_hint(); // The total low estimate is the sum of the already-buffered elements, // plus the low estimate of remaining unbuffered elements, divided by // the tuple size. diff --git a/tests/quick.rs b/tests/quick.rs index 5729cfaf8..267640fe4 100644 --- a/tests/quick.rs +++ b/tests/quick.rs @@ -3,6 +3,8 @@ //! //! In particular we test the tedious size_hint and exact size correctness. +#![allow(deprecated, unstable_name_collisions)] + use itertools::free::{ cloned, enumerate, multipeek, peek_nth, put_back, put_back_n, rciter, zip, zip_eq, }; diff --git a/tests/specializations.rs b/tests/specializations.rs index 7c21da66a..85b46e48b 100644 --- a/tests/specializations.rs +++ b/tests/specializations.rs @@ -1,3 +1,5 @@ +#![allow(unstable_name_collisions)] + use itertools::Itertools; use quickcheck::quickcheck; use std::fmt::Debug; diff --git a/tests/test_core.rs b/tests/test_core.rs index 729d7c3b8..c624a7e33 100644 --- a/tests/test_core.rs +++ b/tests/test_core.rs @@ -4,6 +4,7 @@ //! option. This file may not be copied, modified, or distributed //! except according to those terms. #![no_std] +#![allow(deprecated)] use crate::it::chain; use crate::it::free::put_back; diff --git a/tests/test_std.rs b/tests/test_std.rs index 900d7174e..3ef90f39d 100644 --- a/tests/test_std.rs +++ b/tests/test_std.rs @@ -1,3 +1,5 @@ +#![allow(unstable_name_collisions)] + use crate::it::cloned; use crate::it::free::put_back_n; use crate::it::free::rciter;