run clippy check on beta & address clippy warnings

pull/392/head
Taiki Endo 5 years ago
parent 610c66e774
commit 6549b66ad2

@ -7,12 +7,13 @@ on:
- staging - staging
- trying - trying
env:
RUSTFLAGS: -Dwarnings
jobs: jobs:
build_and_test: build_and_test:
name: Build and test name: Build and test
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: -Dwarnings
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macOS-latest] os: [ubuntu-latest, windows-latest, macOS-latest]
@ -48,8 +49,6 @@ jobs:
check_fmt_and_docs: check_fmt_and_docs:
name: Checking fmt and docs name: Checking fmt and docs
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
@ -81,19 +80,11 @@ jobs:
clippy_check: clippy_check:
name: Clippy check name: Clippy check
runs-on: ubuntu-latest runs-on: ubuntu-latest
# TODO: There is a lot of warnings
# env:
# RUSTFLAGS: -Dwarnings
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- id: component - name: Install rust
uses: actions-rs/components-nightly@v1 run: rustup update beta && rustup default beta
with: - name: Install clippy
component: clippy run: rustup component add clippy
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ steps.component.outputs.toolchain }}
override: true
- run: rustup component add clippy
- name: clippy - name: clippy
run: cargo clippy --all --features unstable run: cargo clippy --all --features unstable

@ -43,6 +43,7 @@
#![cfg_attr(feature = "docs", feature(doc_cfg))] #![cfg_attr(feature = "docs", feature(doc_cfg))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)] #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![allow(clippy::mutex_atomic, clippy::module_inception)]
#![doc(test(attr(deny(rust_2018_idioms, warnings))))] #![doc(test(attr(deny(rust_2018_idioms, warnings))))]
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))] #![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")] #![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]

@ -75,6 +75,7 @@ pub use crate::stream::Stream;
/// assert_eq!(5, counter.len()); /// assert_eq!(5, counter.len());
/// # }); /// # });
/// ``` /// ```
#[allow(clippy::len_without_is_empty)] // ExactSizeIterator::is_empty is unstable
#[cfg(feature = "unstable")] #[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))] #[cfg_attr(feature = "docs", doc(cfg(unstable)))]
pub trait ExactSizeStream: Stream { pub trait ExactSizeStream: Stream {

@ -167,6 +167,7 @@ impl Tag {
} }
pub fn task(&self) -> &Task { pub fn task(&self) -> &Task {
#[allow(clippy::transmute_ptr_to_ptr)]
unsafe { unsafe {
let raw = self.raw_metadata.load(Ordering::Acquire); let raw = self.raw_metadata.load(Ordering::Acquire);
@ -189,6 +190,7 @@ impl Tag {
} }
} }
#[allow(clippy::transmute_ptr_to_ptr)]
mem::transmute::<&AtomicUsize, &Option<Task>>(&self.raw_metadata) mem::transmute::<&AtomicUsize, &Option<Task>>(&self.raw_metadata)
.as_ref() .as_ref()
.unwrap() .unwrap()

Loading…
Cancel
Save