From 6866b24ca1a89fb6e7dbc63e20d8a66ee60a85b8 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 23 Sep 2020 05:55:35 +0900 Subject: [PATCH] ci: deny warnings on '--cfg tokio_unstable' tests (#2859) --- .github/workflows/ci.yml | 6 +++--- tokio/src/runtime/builder.rs | 4 ++-- tokio/src/runtime/tests/loom_pool.rs | 2 +- tokio/src/util/bit.rs | 6 ------ 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61244f90e..756a7677b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,7 @@ jobs: run: cargo test --features full working-directory: tokio env: - RUSTFLAGS: '--cfg tokio_unstable' + RUSTFLAGS: --cfg tokio_unstable -Dwarnings miri: name: miri @@ -156,7 +156,7 @@ jobs: - name: check --each-feature --unstable run: cargo hack check --all --each-feature -Z avoid-dev-deps env: - RUSTFLAGS: --cfg tokio_unstable + RUSTFLAGS: --cfg tokio_unstable -Dwarnings minrust: name: minrust @@ -239,6 +239,6 @@ jobs: run: cargo test --lib --release --features full -- --nocapture $SCOPE working-directory: tokio env: - RUSTFLAGS: --cfg loom --cfg tokio_unstable + RUSTFLAGS: --cfg loom --cfg tokio_unstable -Dwarnings LOOM_MAX_PREEMPTIONS: 2 SCOPE: ${{ matrix.scope }} diff --git a/tokio/src/runtime/builder.rs b/tokio/src/runtime/builder.rs index ed2cd251c..42aed3e90 100644 --- a/tokio/src/runtime/builder.rs +++ b/tokio/src/runtime/builder.rs @@ -1,4 +1,4 @@ -use crate::loom::sync::{Arc, Mutex}; +use crate::loom::sync::Mutex; use crate::runtime::handle::Handle; use crate::runtime::shell::Shell; use crate::runtime::{blocking, io, time, Callback, Runtime, Spawner}; @@ -330,7 +330,7 @@ impl Builder { where F: Fn() + Send + Sync + 'static, { - self.before_stop = Some(Arc::new(f)); + self.before_stop = Some(std::sync::Arc::new(f)); self } diff --git a/tokio/src/runtime/tests/loom_pool.rs b/tokio/src/runtime/tests/loom_pool.rs index ed4848463..47ee19810 100644 --- a/tokio/src/runtime/tests/loom_pool.rs +++ b/tokio/src/runtime/tests/loom_pool.rs @@ -209,7 +209,7 @@ mod group_b { #[test] fn complete_block_on_under_load() { loom::model(|| { - let mut pool = mk_pool(1); + let pool = mk_pool(1); pool.block_on(async { // Trigger a re-schedule diff --git a/tokio/src/util/bit.rs b/tokio/src/util/bit.rs index ee756044a..cf3cb1968 100644 --- a/tokio/src/util/bit.rs +++ b/tokio/src/util/bit.rs @@ -22,12 +22,6 @@ impl Pack { Pack { mask, shift } } - /// Mask used to unpack value - #[cfg(all(test, loom))] - pub(crate) const fn mask(&self) -> usize { - self.mask - } - /// Width, in bits, dedicated to storing the value. pub(crate) const fn width(&self) -> u32 { pointer_width() - (self.mask >> self.shift).leading_zeros()