about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2019-09-09 09:28:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2019-09-23 09:34:44 -0700
commit3a648b65800c5b93531afcec873b5c2da85c8fa2 (patch)
tree839314c7ab43127ba81e9a41fb4fce0f68cadc36 /src/bootstrap
parent1bec962f4687eacb09bf12955c93f6edfd6efee8 (diff)
downloadrust-3a648b65800c5b93531afcec873b5c2da85c8fa2.tar.gz
rust-3a648b65800c5b93531afcec873b5c2da85c8fa2.zip
Move handling of `-Dwarnings` to `builder.rs`
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bin/rustc.rs3
-rw-r--r--src/bootstrap/builder.rs4
2 files changed, 2 insertions, 5 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 8be70c5a287..9c7fba0dd78 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -111,9 +111,6 @@ fn main() {
             cmd.arg("-Zunstable-options");
             cmd.arg("-Wrustc::internal");
         }
-        if env::var_os("RUSTC_DENY_WARNINGS").is_some() {
-            cmd.arg("-Dwarnings");
-        }
     }
 
     if let Some(target) = target {
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 095770f7650..60673cf7cdd 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1055,8 +1055,8 @@ impl<'a> Builder<'a> {
 
         cargo.env("RUSTC_VERBOSE", self.verbosity.to_string());
 
-        if self.config.deny_warnings {
-            cargo.env("RUSTC_DENY_WARNINGS", "1");
+        if self.config.deny_warnings && !mode.is_tool() {
+            rustflags.arg("-Dwarnings");
         }
 
         // Throughout the build Cargo can execute a number of build scripts