about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-05-18 11:01:00 +0200
committerflip1995 <philipp.krones@embecosm.com>2021-05-18 11:05:48 +0200
commitff452d5ba68e4d8b8d8c3b2977f0c8635c6380e9 (patch)
treebe0d9d2f6b9e3865e341a6f97491f522f6923797
parent213b8d9a2b88e0db15bcdf2fd696afa6b7db12c7 (diff)
downloadrust-ff452d5ba68e4d8b8d8c3b2977f0c8635c6380e9.tar.gz
rust-ff452d5ba68e4d8b8d8c3b2977f0c8635c6380e9.zip
Deny warning in every main sub-crate
This enables the same warnings that are enabled in `clippy_lints` also
in `clippy_utils` and `clippy_dev`. Then it makes sure, that the
`deny-warnings` feature is passed down to `clippy_lints` and
`clippy_utils` when compiling Clippy.
-rw-r--r--Cargo.toml2
-rw-r--r--clippy_dev/src/lib.rs4
-rw-r--r--clippy_dev/src/main.rs2
-rw-r--r--clippy_lints/Cargo.toml2
-rw-r--r--clippy_utils/Cargo.toml1
-rw-r--r--clippy_utils/src/lib.rs7
6 files changed, 15 insertions, 3 deletions
diff --git a/Cargo.toml b/Cargo.toml
index f010e609604..848476a9d05 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -49,7 +49,7 @@ rustc-workspace-hack = "1.0.0"
 rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util" }
 
 [features]
-deny-warnings = []
+deny-warnings = ["clippy_lints/deny-warnings"]
 integration = ["tempfile"]
 internal-lints = ["clippy_lints/internal-lints"]
 metadata-collector-lint = ["internal-lints", "clippy_lints/metadata-collector-lint"]
diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs
index 1e5a140e964..69f42aca8b6 100644
--- a/clippy_dev/src/lib.rs
+++ b/clippy_dev/src/lib.rs
@@ -1,5 +1,7 @@
-#![cfg_attr(feature = "deny-warnings", deny(warnings))]
 #![feature(once_cell)]
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
+// warn on lints, that are included in `rust-lang/rust`s bootstrap
+#![warn(rust_2018_idioms, unused_lifetimes)]
 
 use itertools::Itertools;
 use regex::Regex;
diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs
index f4da783502c..7040c257c83 100644
--- a/clippy_dev/src/main.rs
+++ b/clippy_dev/src/main.rs
@@ -1,4 +1,6 @@
 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
+// warn on lints, that are included in `rust-lang/rust`s bootstrap
+#![warn(rust_2018_idioms, unused_lifetimes)]
 
 use clap::{App, Arg, ArgMatches, SubCommand};
 use clippy_dev::{bless, fmt, ide_setup, new_lint, serve, stderr_length_check, update_lints};
diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml
index 7ceb1da6a6e..48f2972ec58 100644
--- a/clippy_lints/Cargo.toml
+++ b/clippy_lints/Cargo.toml
@@ -30,7 +30,7 @@ rustc-semver = "1.1.0"
 url = { version = "2.1.0", features = ["serde"] }
 
 [features]
-deny-warnings = []
+deny-warnings = ["clippy_utils/deny-warnings"]
 # build clippy with internal lints enabled, off by default
 internal-lints = ["clippy_utils/internal-lints"]
 metadata-collector-lint = ["serde_json", "clippy_utils/metadata-collector-lint"]
diff --git a/clippy_utils/Cargo.toml b/clippy_utils/Cargo.toml
index 0a1d4e11142..93ed3b18400 100644
--- a/clippy_utils/Cargo.toml
+++ b/clippy_utils/Cargo.toml
@@ -14,6 +14,7 @@ unicode-normalization = "0.1"
 rustc-semver="1.1.0"
 
 [features]
+deny-warnings = []
 internal-lints = []
 metadata-collector-lint = []
 
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index 371fe23bedc..886dde4b977 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -3,7 +3,14 @@
 #![feature(iter_zip)]
 #![feature(rustc_private)]
 #![recursion_limit = "512"]
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
 #![allow(clippy::missing_errors_doc, clippy::missing_panics_doc, clippy::must_use_candidate)]
+// warn on the same lints as `clippy_lints`
+#![warn(trivial_casts, trivial_numeric_casts)]
+// warn on lints, that are included in `rust-lang/rust`s bootstrap
+#![warn(rust_2018_idioms, unused_lifetimes)]
+// warn on rustc internal lints
+#![warn(rustc::internal)]
 
 // FIXME: switch to something more ergonomic here, once available.
 // (Currently there is no way to opt into sysroot crates without `extern crate`.)