Skip to content

Commit ff452d5

Browse files
committed
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.
1 parent 213b8d9 commit ff452d5

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ rustc-workspace-hack = "1.0.0"
4949
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util" }
5050

5151
[features]
52-
deny-warnings = []
52+
deny-warnings = ["clippy_lints/deny-warnings"]
5353
integration = ["tempfile"]
5454
internal-lints = ["clippy_lints/internal-lints"]
5555
metadata-collector-lint = ["internal-lints", "clippy_lints/metadata-collector-lint"]

clippy_dev/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
21
#![feature(once_cell)]
2+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
3+
// warn on lints, that are included in `rust-lang/rust`s bootstrap
4+
#![warn(rust_2018_idioms, unused_lifetimes)]
35

46
use itertools::Itertools;
57
use regex::Regex;

clippy_dev/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
2+
// warn on lints, that are included in `rust-lang/rust`s bootstrap
3+
#![warn(rust_2018_idioms, unused_lifetimes)]
24

35
use clap::{App, Arg, ArgMatches, SubCommand};
46
use clippy_dev::{bless, fmt, ide_setup, new_lint, serve, stderr_length_check, update_lints};

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rustc-semver = "1.1.0"
3030
url = { version = "2.1.0", features = ["serde"] }
3131

3232
[features]
33-
deny-warnings = []
33+
deny-warnings = ["clippy_utils/deny-warnings"]
3434
# build clippy with internal lints enabled, off by default
3535
internal-lints = ["clippy_utils/internal-lints"]
3636
metadata-collector-lint = ["serde_json", "clippy_utils/metadata-collector-lint"]

clippy_utils/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ unicode-normalization = "0.1"
1414
rustc-semver="1.1.0"
1515

1616
[features]
17+
deny-warnings = []
1718
internal-lints = []
1819
metadata-collector-lint = []
1920

clippy_utils/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
#![feature(iter_zip)]
44
#![feature(rustc_private)]
55
#![recursion_limit = "512"]
6+
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
67
#![allow(clippy::missing_errors_doc, clippy::missing_panics_doc, clippy::must_use_candidate)]
8+
// warn on the same lints as `clippy_lints`
9+
#![warn(trivial_casts, trivial_numeric_casts)]
10+
// warn on lints, that are included in `rust-lang/rust`s bootstrap
11+
#![warn(rust_2018_idioms, unused_lifetimes)]
12+
// warn on rustc internal lints
13+
#![warn(rustc::internal)]
714

815
// FIXME: switch to something more ergonomic here, once available.
916
// (Currently there is no way to opt into sysroot crates without `extern crate`.)

0 commit comments

Comments
 (0)