Ensure all warnings are emitted even on warnings=warn
This commit is contained in:
parent
5f42f3e108
commit
c86ea34639
2 changed files with 9 additions and 7 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -631,8 +631,9 @@ class RustBuild(object):
|
|||
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"]
|
||||
|
|
Loading…
Reference in a new issue