Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change default lint level to warning and deny warnings in CI #1416

Merged
merged 2 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pr: ["master", "std-future"]

variables:
nightly: nightly-2019-07-17
RUSTFLAGS: -Dwarnings
Copy link
Member Author

@taiki-e taiki-e Aug 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I forgot to add this to .cirrus.yml.

Update: Filed #1425


jobs:
# Check formatting
Expand Down
2 changes: 1 addition & 1 deletion ci/azure-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
cargo clippy --version
displayName: Install clippy
- script: |
cargo clippy --all --all-features -- -D warnings -A clippy::mutex-atomic
cargo clippy --all --all-features -- -A clippy::mutex-atomic
displayName: cargo clippy --all
3 changes: 1 addition & 2 deletions tokio-buf/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#![doc(html_root_url = "https://docs.rs/tokio-buf/0.2.0-alpha.1")]
#![deny(
#![warn(
missing_docs,
missing_debug_implementations,
unreachable_pub,
rust_2018_idioms
)]
#![cfg_attr(test, deny(warnings))]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

//! Asynchronous stream of bytes.
Expand Down
3 changes: 1 addition & 2 deletions tokio-codec/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc(html_root_url = "https://docs.rs/tokio-codec/0.2.0-alpha.1")]
#![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

//! Utilities for encoding and decoding frames.
Expand Down
2 changes: 1 addition & 1 deletion tokio-codec/tests/codecs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use bytes::{BufMut, Bytes, BytesMut};
use tokio_codec::{BytesCodec, Decoder, Encoder, LinesCodec};
Expand Down
2 changes: 1 addition & 1 deletion tokio-codec/tests/framed.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(async_await)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use tokio::prelude::*;
use tokio_codec::{Decoder, Encoder, Framed, FramedParts};
Expand Down
2 changes: 1 addition & 1 deletion tokio-codec/tests/framed_read.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(async_await)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use tokio::prelude::*;
use tokio_codec::{Decoder, FramedRead};
Expand Down
2 changes: 1 addition & 1 deletion tokio-codec/tests/framed_write.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use tokio_codec::{Encoder, FramedWrite};
use tokio_io::AsyncWrite;
Expand Down
2 changes: 1 addition & 1 deletion tokio-codec/tests/length_delimited.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use tokio::codec::*;
use tokio::io::{AsyncRead, AsyncWrite};
Expand Down
3 changes: 1 addition & 2 deletions tokio-current-thread/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc(html_root_url = "https://docs.rs/tokio-current-thread/0.2.0-alpha.1")]
#![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

//! A single-threaded executor which executes tasks on the same thread from which
Expand Down
2 changes: 1 addition & 1 deletion tokio-current-thread/tests/current_thread.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use std::any::Any;
Expand Down
3 changes: 1 addition & 2 deletions tokio-executor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc(html_root_url = "https://docs.rs/tokio-executor/0.2.0-alpha.1")]
#![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

//! Task execution related traits and utilities.
Expand Down
2 changes: 1 addition & 1 deletion tokio-executor/tests/enter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(await_macro, async_await)]

#[test]
Expand Down
2 changes: 1 addition & 1 deletion tokio-executor/tests/executor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(await_macro, async_await)]

use tokio_executor::{self, DefaultExecutor};
Expand Down
1 change: 0 additions & 1 deletion tokio-fs/examples_old/std-echo.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Echo everything received on STDIN to STDOUT.
#![deny(deprecated, warnings)]
#![feature(async_await)]

use tokio_codec::{FramedRead, FramedWrite, LinesCodec};
Expand Down
3 changes: 1 addition & 2 deletions tokio-fs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc(html_root_url = "https://docs.rs/tokio-fs/0.2.0-alpha.1")]
#![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![feature(async_await)]

Expand Down
2 changes: 1 addition & 1 deletion tokio-fs/tests/dir.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use futures_util::future;
Expand Down
2 changes: 1 addition & 1 deletion tokio-fs/tests/file.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use rand::{distributions, thread_rng, Rng};
Expand Down
2 changes: 1 addition & 1 deletion tokio-fs/tests/link.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use std::fs;
Expand Down
3 changes: 1 addition & 2 deletions tokio-io/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc(html_root_url = "https://docs.rs/tokio-io/0.2.0-alpha.1")]
#![deny(missing_debug_implementations, missing_docs, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

//! Core I/O traits and combinators when working with Tokio.
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/copy.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_io::{AsyncRead, AsyncReadExt};
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/lines.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use futures_util::StreamExt;
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/read.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_io::{AsyncRead, AsyncReadExt};
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/read_exact.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_io::AsyncReadExt;
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/read_line.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use std::io::Cursor;
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/read_to_end.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_io::AsyncReadExt;
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/read_to_string.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_io::AsyncReadExt;
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/read_until.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_io::AsyncBufReadExt;
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/write.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_io::{AsyncWrite, AsyncWriteExt};
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/tests/write_all.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_io::{AsyncWrite, AsyncWriteExt};
Expand Down
3 changes: 1 addition & 2 deletions tokio-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc(html_root_url = "https://docs.rs/tokio-macros/0.2.0-alpha.1")]
#![deny(missing_debug_implementations, unreachable_pub, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_debug_implementations, unreachable_pub, rust_2018_idioms)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

//! Macros for use with Tokio
Expand Down
3 changes: 1 addition & 2 deletions tokio-process/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@
//! be regained with the `Child::forget` method.

#![doc(html_root_url = "https://docs.rs/tokio-process/0.3.0")]
#![deny(missing_debug_implementations, missing_docs, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![feature(async_await)]

Expand Down
2 changes: 1 addition & 1 deletion tokio-process/tests/issue_42.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use futures_util::future::FutureExt;
use futures_util::stream::FuturesOrdered;
Expand Down
2 changes: 1 addition & 1 deletion tokio-process/tests/smoke.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use tokio_process::CommandExt;
Expand Down
2 changes: 1 addition & 1 deletion tokio-process/tests/stdio.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion tokio-process/tests/support/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use futures_util::future;
use futures_util::future::FutureExt;
Expand Down
2 changes: 1 addition & 1 deletion tokio-reactor/benches/basic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(test)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

/*
extern crate test;
Expand Down
3 changes: 1 addition & 2 deletions tokio-reactor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc(html_root_url = "https://docs.rs/tokio-reactor/0.2.0-alpha.1")]
#![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

//! Event loop that drives Tokio I/O resources.
Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/examples/ctrl-c.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use futures_util::stream::StreamExt;
Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/examples/multiple.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

//! A small example of how to listen for two signals at the same time
Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/examples/sighup-example.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

// A trick to not fail build on non-unix platforms when using unix-specific features.
Expand Down
3 changes: 1 addition & 2 deletions tokio-signal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc(html_root_url = "https://docs.rs/tokio-signal/0.3.0-alpha.1")]
#![deny(missing_debug_implementations, missing_docs, rust_2018_idioms)]
#![cfg_attr(test, deny(warnings))]
#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)]
#![cfg_attr(test, feature(async_await))]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]

Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/tests/drop_multi_loop.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use libc;

Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/tests/drop_then_get_a_signal.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use libc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use libc;
Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/tests/multi_loop.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

pub mod support;
use crate::support::*;
Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/tests/notify_both.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

pub mod support;
Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/tests/simple.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

pub mod support;
Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/tests/support.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use futures_util::future::FutureExt;
use libc::{c_int, getpid, kill};
Expand Down
2 changes: 1 addition & 1 deletion tokio-signal/tests/twice.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

pub mod support;
Expand Down
2 changes: 1 addition & 1 deletion tokio-sync/benches/mpsc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(test)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

extern crate test;

Expand Down
2 changes: 1 addition & 1 deletion tokio-sync/benches/oneshot.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(test)]
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

extern crate test;

Expand Down
3 changes: 1 addition & 2 deletions tokio-sync/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#![doc(html_root_url = "https://docs.rs/tokio-sync/0.2.0-alpha.1")]
#![deny(
#![warn(
missing_debug_implementations,
missing_docs,
unreachable_pub,
rust_2018_idioms
)]
#![cfg_attr(test, deny(warnings))]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![feature(async_await)]

Expand Down
6 changes: 4 additions & 2 deletions tokio-sync/src/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ use crate::task::AtomicWaker;
use core::task::Poll::{Pending, Ready};
use core::task::{Context, Poll};
use fnv::FnvHashMap;
use futures_core::ready;
use futures_util::future::poll_fn;
use futures_util::pin_mut;
use std::ops;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::SeqCst;
use std::sync::{Arc, Mutex, RwLock, RwLockReadGuard, Weak};

#[cfg(feature = "async-traits")]
use futures_core::ready;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a change to fix the warnings mentioned in #1416 (comment).
https://dev.azure.com/tokio-rs/Tokio/_build/results?buildId=1874

error: unused import: `futures_core::ready`
  --> tokio-sync/src/watch.rs:63:5
   |
63 | use futures_core::ready;
   |     ^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D unused-imports` implied by `-D warnings`

error: unused import: `futures_util::pin_mut`
  --> tokio-sync/src/watch.rs:65:5
   |
65 | use futures_util::pin_mut;
   |     ^^^^^^^^^^^^^^^^^^^^^

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see now 👍

#[cfg(feature = "async-traits")]
use futures_util::pin_mut;
#[cfg(feature = "async-traits")]
use std::pin::Pin;

Expand Down
2 changes: 1 addition & 1 deletion tokio-sync/tests/atomic_waker.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

use std::task::Waker;
use tokio_sync::AtomicWaker;
Expand Down
2 changes: 1 addition & 1 deletion tokio-sync/tests/errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(warnings, rust_2018_idioms)]
#![warn(rust_2018_idioms)]

fn is_error<T: ::std::error::Error + Send + Sync>() {}

Expand Down
Loading