From 1d3ec29880fc991b2ae2feb62145627651d732f6 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Mon, 25 Nov 2019 17:23:07 +0100 Subject: [PATCH 1/2] Remove unused debugging feature --- Cargo.toml | 1 - appveyor.yml | 4 ++-- ci/base-tests.sh | 4 ++-- clippy_lints/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 82a2e71bb2b..b572aebdbbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,4 +58,3 @@ rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"} [features] deny-warnings = [] -debugging = [] diff --git a/appveyor.yml b/appveyor.yml index 58693cb5cc3..d0271bc2a83 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,10 +37,10 @@ install: build: false build_script: - - cargo build --features debugging + - cargo build --features deny-warnings test_script: - - cargo test --features debugging + - cargo test --features deny-warnings notifications: - provider: Email diff --git a/ci/base-tests.sh b/ci/base-tests.sh index 4a64b19d80a..77af3eb8f87 100755 --- a/ci/base-tests.sh +++ b/ci/base-tests.sh @@ -12,8 +12,8 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then remark -f ./*.md -f doc/*.md > /dev/null fi # build clippy in debug mode and run tests -cargo build --features "debugging deny-warnings" -cargo test --features "debugging deny-warnings" +cargo build --features deny-warnings +cargo test --features deny-warnings (cd clippy_lints && cargo test) (cd rustc_tools_util && cargo test) diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index 608fb668c5a..dae403cbb4f 100644 --- a/clippy_lints/Cargo.toml +++ b/clippy_lints/Cargo.toml @@ -35,4 +35,4 @@ semver = "0.9.0" url = { version = "2.1.0", features = ["serde"] } [features] -debugging = [] +deny-warnings = [] From d51a80c57e85f6d96c700410f8ba60d94ffaaba8 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Mon, 25 Nov 2019 17:23:48 +0100 Subject: [PATCH 2/2] Enable deny-warnings feature everywhere in CI --- ci/base-tests.sh | 6 +++--- clippy_dev/Cargo.toml | 3 +++ clippy_dev/src/lib.rs | 2 ++ clippy_dev/src/main.rs | 2 ++ rustc_tools_util/Cargo.toml | 4 ++++ rustc_tools_util/src/lib.rs | 2 ++ 6 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ci/base-tests.sh b/ci/base-tests.sh index 77af3eb8f87..d3fd262b600 100755 --- a/ci/base-tests.sh +++ b/ci/base-tests.sh @@ -15,9 +15,9 @@ fi cargo build --features deny-warnings cargo test --features deny-warnings -(cd clippy_lints && cargo test) -(cd rustc_tools_util && cargo test) -(cd clippy_dev && cargo test) +(cd clippy_lints && cargo test --features deny-warnings) +(cd rustc_tools_util && cargo test --features deny-warnings) +(cd clippy_dev && cargo test --features deny-warnings) # make sure clippy can be called via ./path/to/cargo-clippy ( diff --git a/clippy_dev/Cargo.toml b/clippy_dev/Cargo.toml index e2e946d06f2..b30ba61d299 100644 --- a/clippy_dev/Cargo.toml +++ b/clippy_dev/Cargo.toml @@ -11,3 +11,6 @@ regex = "1" lazy_static = "1.0" shell-escape = "0.1" walkdir = "2" + +[features] +deny-warnings = [] diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs index 327774ea0f2..f73e7b86720 100644 --- a/clippy_dev/src/lib.rs +++ b/clippy_dev/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(feature = "deny-warnings", deny(warnings))] + use itertools::Itertools; use lazy_static::lazy_static; use regex::Regex; diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index 9c9d3eae588..3010e0d2489 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -1,3 +1,5 @@ +#![cfg_attr(feature = "deny-warnings", deny(warnings))] + extern crate clap; extern crate clippy_dev; extern crate regex; diff --git a/rustc_tools_util/Cargo.toml b/rustc_tools_util/Cargo.toml index 5d37f935375..6f0fc5bee8f 100644 --- a/rustc_tools_util/Cargo.toml +++ b/rustc_tools_util/Cargo.toml @@ -9,4 +9,8 @@ license = "MIT OR Apache-2.0" keywords = ["rustc", "tool", "git", "version", "hash"] categories = ["development-tools"] edition = "2018" + [dependencies] + +[features] +deny-warnings = [] diff --git a/rustc_tools_util/src/lib.rs b/rustc_tools_util/src/lib.rs index 36b58a398dc..ff2a7de5725 100644 --- a/rustc_tools_util/src/lib.rs +++ b/rustc_tools_util/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(feature = "deny-warnings", deny(warnings))] + use std::env; #[macro_export]