diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-06-26 00:39:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-26 00:39:01 -0700 |
| commit | 10d655bb474c2437e38e2926fc3f4d792bd7f7e9 (patch) | |
| tree | 860895555877490544645d5d05dec73177277704 /src/bootstrap/check.rs | |
| parent | 2aee60897fc85c575ae5597861a9b40c6cdcab74 (diff) | |
| parent | 75983e137eeae5e9b210c2e97e6239bf888d9620 (diff) | |
Rollup merge of #73297 - ehuss:tool-warnings, r=Mark-Simulacrum
Support configurable deny-warnings for all in-tree crates. This removes the hard-coded `deny(warnings)` on all in-tree tools, and allows it to be configured from the config. This is just a personal preference, as I find `deny(warnings)` frustrating during development or doing small tests. This also fixes some regressions in terms of warning handling. Warnings used to be dependent on `SourceType`, but in #64316 it was changed to be based on `Mode`. This means tools like rustdoc no longer used the same settings as the rest of the tree. It also made `SourceType` useless since the only thing it was used for was warnings. I think it would be better for everything in the tree to use the same settings. Fixes #64523
Diffstat (limited to 'src/bootstrap/check.rs')
| -rw-r--r-- | src/bootstrap/check.rs | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 7a8bfb2d5d8..0d38d2eebe7 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -44,7 +44,13 @@ impl Step for Std { let target = self.target; let compiler = builder.compiler(0, builder.config.build); - let mut cargo = builder.cargo(compiler, Mode::Std, target, cargo_subcommand(builder.kind)); + let mut cargo = builder.cargo( + compiler, + Mode::Std, + SourceType::InTree, + target, + cargo_subcommand(builder.kind), + ); std_cargo(builder, target, compiler.stage, &mut cargo); builder.info(&format!("Checking std artifacts ({} -> {})", &compiler.host, target)); @@ -92,8 +98,13 @@ impl Step for Rustc { builder.ensure(Std { target }); - let mut cargo = - builder.cargo(compiler, Mode::Rustc, target, cargo_subcommand(builder.kind)); + let mut cargo = builder.cargo( + compiler, + Mode::Rustc, + SourceType::InTree, + target, + cargo_subcommand(builder.kind), + ); rustc_cargo(builder, &mut cargo, target); builder.info(&format!("Checking compiler artifacts ({} -> {})", &compiler.host, target)); @@ -113,7 +124,7 @@ impl Step for Rustc { } macro_rules! tool_check_step { - ($name:ident, $path:expr) => { + ($name:ident, $path:expr, $source_type:expr) => { #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct $name { pub target: Interned<String>, @@ -145,7 +156,7 @@ macro_rules! tool_check_step { target, cargo_subcommand(builder.kind), $path, - SourceType::InTree, + $source_type, &[], ); @@ -184,8 +195,12 @@ macro_rules! tool_check_step { }; } -tool_check_step!(Rustdoc, "src/tools/rustdoc"); -tool_check_step!(Clippy, "src/tools/clippy"); +tool_check_step!(Rustdoc, "src/tools/rustdoc", SourceType::InTree); +// Clippy is a hybrid. It is an external tool, but uses a git subtree instead +// of a submodule. Since the SourceType only drives the deny-warnings +// behavior, treat it as in-tree so that any new warnings in clippy will be +// rejected. +tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree); /// Cargo's output path for the standard library in a given stage, compiled /// by a particular compiler for the specified target. |
