Skip to content

Commit f8b19f2

Browse files
committed
Move handling of some warnings to builder.rs
1 parent 3a648b6 commit f8b19f2

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,6 @@ fn main() {
102102
}
103103

104104
if env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
105-
// When extending this list, add the new lints to the RUSTFLAGS of the
106-
// build_bootstrap function of src/bootstrap/bootstrap.py as well as
107-
// some code doesn't go through this `rustc` wrapper.
108-
cmd.arg("-Wrust_2018_idioms");
109-
cmd.arg("-Wunused_lifetimes");
110105
if use_internal_lints(crate_name) {
111106
cmd.arg("-Zunstable-options");
112107
cmd.arg("-Wrustc::internal");

src/bootstrap/builder.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,8 +1055,16 @@ impl<'a> Builder<'a> {
10551055

10561056
cargo.env("RUSTC_VERBOSE", self.verbosity.to_string());
10571057

1058-
if self.config.deny_warnings && !mode.is_tool() {
1059-
rustflags.arg("-Dwarnings");
1058+
if !mode.is_tool() {
1059+
// When extending this list, add the new lints to the RUSTFLAGS of the
1060+
// build_bootstrap function of src/bootstrap/bootstrap.py as well as
1061+
// some code doesn't go through this `rustc` wrapper.
1062+
rustflags.arg("-Wrust_2018_idioms");
1063+
rustflags.arg("-Wunused_lifetimes");
1064+
1065+
if self.config.deny_warnings {
1066+
rustflags.arg("-Dwarnings");
1067+
}
10601068
}
10611069

10621070
// Throughout the build Cargo can execute a number of build scripts

0 commit comments

Comments
 (0)