]> git.lizzy.rs Git - rust.git/commitdiff
rustbuild: allow disabling deny(warnings) for bootstrap
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Tue, 27 Aug 2019 07:37:51 +0000 (09:37 +0200)
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Tue, 27 Aug 2019 15:26:54 +0000 (17:26 +0200)
When deny-warnings is not specified or set to true, the behaviour is the same as before.
When deny-warnings is set to false, warnings are now allowed

Fixes #63911

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
src/bootstrap/bin/main.rs
src/bootstrap/bin/rustc.rs
src/bootstrap/bin/rustdoc.rs
src/bootstrap/bootstrap.py
src/bootstrap/lib.rs
src/build_helper/lib.rs

index bd1a87c5744d39d8c1a552a0925ff18a53b627d8..138b7f4b261046bad584bd2acd730da9e5b1bcf0 100644 (file)
@@ -5,9 +5,6 @@
 //! parent directory, and otherwise documentation can be found throughout the `build`
 //! directory in each respective module.
 
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
 use std::env;
 
 use bootstrap::{Config, Build};
index ce92ce026967117016ab27620dafaad86770e207..8cb48df14bfefd334bc4ef712e9b516075d9b4e1 100644 (file)
@@ -15,9 +15,6 @@
 //! switching compilers for the bootstrap and for build scripts will probably
 //! never get replaced.
 
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
 use std::env;
 use std::ffi::OsString;
 use std::io;
@@ -124,8 +121,9 @@ fn main() {
 
     if env::var_os("RUSTC_DENY_WARNINGS").is_some() &&
        env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
-        // When extending this list, search for `NO-RUSTC-WRAPPER` and add the new lints
-        // there as well, some code doesn't go through this `rustc` wrapper.
+        // When extending this list, add the new lints to the RUSTFLAGS of the
+        // build_bootstrap function of src/bootstrap/bootstrap.py as well as
+        // some code doesn't go through this `rustc` wrapper.
         cmd.arg("-Dwarnings");
         cmd.arg("-Drust_2018_idioms");
         cmd.arg("-Dunused_lifetimes");
index ff38ee8788f5652c2c551ff3db1a120a89a27c2c..766a3463ecd8b36f5132c3ee0128a68fc05ee720 100644 (file)
@@ -2,9 +2,6 @@
 //!
 //! See comments in `src/bootstrap/rustc.rs` for more information.
 
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
 use std::env;
 use std::process::Command;
 use std::path::PathBuf;
index 86901792d79740f1467f53baeb4862f598aad9e3..3c56131396f29de1fc08ecef859783a81b6c4729 100644 (file)
@@ -631,6 +631,8 @@ class RustBuild(object):
         target_linker = self.get_toml("linker", build_section)
         if target_linker is not None:
             env["RUSTFLAGS"] += "-C linker=" + target_linker + " "
+        if self.get_toml("deny-warnings", "rust") != "false":
+            env["RUSTFLAGS"] += "-Dwarnings -Drust_2018_idioms -Dunused_lifetimes "
 
         env["PATH"] = os.path.join(self.bin_root(), "bin") + \
             os.pathsep + env["PATH"]
index c0e0ad1a857b954ab1a69c8736cb0a84928dca11..575844028d562a9c488a6232c22c735c84818b69 100644 (file)
 //! More documentation can be found in each respective module below, and you can
 //! also check out the `src/bootstrap/README.md` file for more information.
 
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
 #![feature(core_intrinsics)]
 #![feature(drain_filter)]
 
index 131d2034675e3db0f0897258dd90493c9c87ba38..f035a7119188a1aa3c415e09096e20b8e896104f 100644 (file)
@@ -1,6 +1,3 @@
-// NO-RUSTC-WRAPPER
-#![deny(warnings, rust_2018_idioms, unused_lifetimes)]
-
 use std::fs::File;
 use std::path::{Path, PathBuf};
 use std::process::{Command, Stdio};