From 264442c140fb277f07b2d45a1fb0cef96e0a2caa Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Fri, 23 Apr 2021 12:05:12 -0400 Subject: [PATCH 1/2] Don't rebuild rustdoc after checking bootstrap This works by unconditionally passing -Z unstable-options to the compiler. This has no affect in practice since bootstrap doesn't use `deny(rustc::internal)`. --- src/bootstrap/check.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 6626fead774d6..ca8ea63047ba4 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -321,11 +321,9 @@ macro_rules! tool_check_step { } // Enable internal lints for clippy and rustdoc - // NOTE: this intentionally doesn't enable lints for any other tools, - // see https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776 - if $path == "src/tools/rustdoc" || $path == "src/tools/clippy" { - cargo.rustflag("-Zunstable-options"); - } + // NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![deny(rustc::internal)]` + // See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776 + cargo.rustflag("-Zunstable-options"); builder.info(&format!( "Checking stage{} {} artifacts ({} -> {})", From 1c8e12217704c3290bfb05f0f75688b6a7849e75 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Tue, 27 Apr 2021 13:00:36 -0400 Subject: [PATCH 2/2] Switch `rustc::internal` from deny to warn These should still obey deny-warnings. --- src/bootstrap/check.rs | 2 +- src/librustdoc/lib.rs | 2 +- src/tools/clippy/clippy_lints/src/lib.rs | 2 +- src/tools/clippy/src/driver.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index ca8ea63047ba4..38dda5b744e05 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -321,7 +321,7 @@ macro_rules! tool_check_step { } // Enable internal lints for clippy and rustdoc - // NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![deny(rustc::internal)]` + // NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]` // See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776 cargo.rustflag("-Zunstable-options"); diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 2a51d78f64a39..222d362ba6b9b 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -16,7 +16,7 @@ #![feature(type_ascription)] #![feature(iter_intersperse)] #![recursion_limit = "256"] -#![deny(rustc::internal)] +#![warn(rustc::internal)] #[macro_use] extern crate lazy_static; diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs index 11fef30945d78..22e6bb822b8c2 100644 --- a/src/tools/clippy/clippy_lints/src/lib.rs +++ b/src/tools/clippy/clippy_lints/src/lib.rs @@ -17,7 +17,7 @@ // warn on lints, that are included in `rust-lang/rust`s bootstrap #![warn(rust_2018_idioms, unused_lifetimes)] // warn on rustc internal lints -#![deny(rustc::internal)] +#![warn(rustc::internal)] // FIXME: switch to something more ergonomic here, once available. // (Currently there is no way to opt into sysroot crates without `extern crate`.) diff --git a/src/tools/clippy/src/driver.rs b/src/tools/clippy/src/driver.rs index fa0c5f01430b6..750a23e8c9841 100644 --- a/src/tools/clippy/src/driver.rs +++ b/src/tools/clippy/src/driver.rs @@ -4,7 +4,7 @@ // warn on lints, that are included in `rust-lang/rust`s bootstrap #![warn(rust_2018_idioms, unused_lifetimes)] // warn on rustc internal lints -#![deny(rustc::internal)] +#![warn(rustc::internal)] // FIXME: switch to something more ergonomic here, once available. // (Currently there is no way to opt into sysroot crates without `extern crate`.)