Skip to content

Commit

Permalink
Ensure all warnings are emitted even on warnings=warn
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Sep 4, 2019
1 parent 5f42f3e commit c86ea34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,18 @@ fn main() {
cmd.arg(format!("-Cdebuginfo={}", debuginfo_level));
}

if env::var_os("RUSTC_DENY_WARNINGS").is_some() &&
env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
if env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
// 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");
cmd.arg("-Wrust_2018_idioms");
cmd.arg("-Wunused_lifetimes");
if use_internal_lints(crate_name) {
cmd.arg("-Zunstable-options");
cmd.arg("-Drustc::internal");
cmd.arg("-Wrustc::internal");
}
if env::var_os("RUSTC_DENY_WARNINGS").is_some() {
cmd.arg("-Dwarnings");
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,9 @@ def build_bootstrap(self):
target_linker = self.get_toml("linker", build_section)
if target_linker is not None:
env["RUSTFLAGS"] += "-C linker=" + target_linker + " "
env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes "
if self.get_toml("deny-warnings", "rust") != "false":
env["RUSTFLAGS"] += "-Dwarnings -Drust_2018_idioms -Dunused_lifetimes "
env["RUSTFLAGS"] += "-Dwarnings "

env["PATH"] = os.path.join(self.bin_root(), "bin") + \
os.pathsep + env["PATH"]
Expand Down

0 comments on commit c86ea34

Please sign in to comment.