about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-29 05:24:45 +0000
committerbors <bors@rust-lang.org>2021-04-29 05:24:45 +0000
commitd337cec9af59af14bde28fc8e5b250c1b31c1b72 (patch)
treec0e10863dd07c1f69287bc7b245d0d92a33b63f2 /src
parentada102456de38e462b4f00473dd923f15dc3f296 (diff)
parent5d2ac6f7a5891c205078ad7cb983111c8d600052 (diff)
downloadrust-d337cec9af59af14bde28fc8e5b250c1b31c1b72.tar.gz
rust-d337cec9af59af14bde28fc8e5b250c1b31c1b72.zip
Auto merge of #84684 - jackh726:rollup-qxc5cos, r=jackh726
Rollup of 11 pull requests

Successful merges:

 - #84484 (Don't rebuild rustdoc and clippy after checking bootstrap)
 - #84530 (`test tidy` should ignore alternative `build` dir patterns)
 - #84531 (Ignore commented out lines when finding features)
 - #84540 (Build sanitizers for x86_64-unknown-linux-musl)
 - #84555 (Set `backtrace-on-ice` by default for compiler and codegen profiles)
 - #84585 (Add `x.py check src/librustdoc` as an alias for `x.py check src/tools/rustdoc`)
 - #84636 (rustdoc: change aliases attribute to data-aliases)
 - #84646 (Add some regression tests related to #82494)
 - #84661 (Remove extra word in `rustc_mir` docs)
 - #84663 (Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` instead)
 - #84668 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/check.rs14
-rw-r--r--src/bootstrap/defaults/config.codegen.toml2
-rw-r--r--src/bootstrap/defaults/config.compiler.toml2
-rw-r--r--src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile1
m---------src/doc/book0
m---------src/doc/reference0
m---------src/doc/rust-by-example0
m---------src/doc/rustc-dev-guide0
-rw-r--r--src/librustdoc/html/render/mod.rs2
-rw-r--r--src/librustdoc/html/static/main.js2
-rw-r--r--src/librustdoc/lib.rs2
-rw-r--r--src/test/rustdoc/auto_aliases.rs2
-rw-r--r--src/test/ui/typeck/issue-75883.rs22
-rw-r--r--src/test/ui/typeck/issue-75883.stderr52
-rw-r--r--src/test/ui/typeck/issue-80779.rs13
-rw-r--r--src/test/ui/typeck/issue-80779.stderr21
-rw-r--r--src/tools/clippy/clippy_lints/src/lib.rs2
-rw-r--r--src/tools/clippy/src/driver.rs2
-rw-r--r--src/tools/tidy/src/features.rs9
19 files changed, 134 insertions, 14 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 6626fead774..9b76c8b9a2d 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -280,7 +280,7 @@ impl Step for CodegenBackend {
 }
 
 macro_rules! tool_check_step {
-    ($name:ident, $path:expr, $source_type:expr) => {
+    ($name:ident, $path:literal, $($alias:literal, )* $source_type:path) => {
         #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
         pub struct $name {
             pub target: TargetSelection,
@@ -292,7 +292,7 @@ macro_rules! tool_check_step {
             const DEFAULT: bool = true;
 
             fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-                run.path($path)
+                run.paths(&[ $path, $($alias),* ])
             }
 
             fn make_run(run: RunConfig<'_>) {
@@ -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 `#![warn(rustc::internal)]`
+                // See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
+                cargo.rustflag("-Zunstable-options");
 
                 builder.info(&format!(
                     "Checking stage{} {} artifacts ({} -> {})",
@@ -363,7 +361,7 @@ macro_rules! tool_check_step {
     };
 }
 
-tool_check_step!(Rustdoc, "src/tools/rustdoc", SourceType::InTree);
+tool_check_step!(Rustdoc, "src/tools/rustdoc", "src/librustdoc", 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
diff --git a/src/bootstrap/defaults/config.codegen.toml b/src/bootstrap/defaults/config.codegen.toml
index a9505922ca7..011ff6821b7 100644
--- a/src/bootstrap/defaults/config.codegen.toml
+++ b/src/bootstrap/defaults/config.codegen.toml
@@ -11,3 +11,5 @@ assertions = true
 debug-logging = true
 # This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
 incremental = true
+# Print backtrace on internal compiler errors during bootstrap
+backtrace-on-ice = true
diff --git a/src/bootstrap/defaults/config.compiler.toml b/src/bootstrap/defaults/config.compiler.toml
index 883bfead64e..4d689d117bc 100644
--- a/src/bootstrap/defaults/config.compiler.toml
+++ b/src/bootstrap/defaults/config.compiler.toml
@@ -6,6 +6,8 @@
 debug-logging = true
 # This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
 incremental = true
+# Print backtrace on internal compiler errors during bootstrap
+backtrace-on-ice = true
 
 [llvm]
 # Will download LLVM from CI if available on your platform.
diff --git a/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
index 08f07eb8284..ea70771a570 100644
--- a/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
@@ -38,6 +38,7 @@ ENV HOSTS=x86_64-unknown-linux-musl
 ENV RUST_CONFIGURE_ARGS \
       --musl-root-x86_64=/usr/local/x86_64-linux-musl \
       --enable-extended \
+      --enable-sanitizers \
       --enable-profiler \
       --enable-lld \
       --set target.x86_64-unknown-linux-musl.crt-static=false \
diff --git a/src/doc/book b/src/doc/book
-Subproject b54090a99ec7c4b46a5203a9c927fdbc311bb1f
+Subproject 50dd06cb71beb27fdc0eebade5509cdcc1f821e
diff --git a/src/doc/reference b/src/doc/reference
-Subproject e1abb17cd94cd5a8a374b48e1bc8134a2208ed4
+Subproject d23f9da8469617e6c81121d9fd123443df70595
diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example
-Subproject c80f0b09fc15b9251825343be910c08531938ab
+Subproject e0a721f5202e6d9bec0aff99f10e44480c0da9e
diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide
-Subproject a9bd2bbf31e4f92b5d3d8e80b22839d0cc7a202
+Subproject e72b43a64925ce053dc7830e21c1a57ba00499b
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 518dbc6eeb3..7de72d81987 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -1546,7 +1546,7 @@ fn render_impl(
         let aliases = if aliases.is_empty() {
             String::new()
         } else {
-            format!(" aliases=\"{}\"", aliases.join(","))
+            format!(" data-aliases=\"{}\"", aliases.join(","))
         };
         if let Some(use_absolute) = use_absolute {
             write!(
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 7fbb97beae7..95b18490641 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -834,7 +834,7 @@ function hideThemeButtonState() {
             // (like "Send" and "Sync").
             var inlined_types = new Set();
             onEachLazy(synthetic_implementors.getElementsByClassName("impl"), function(el) {
-                var aliases = el.getAttribute("aliases");
+                var aliases = el.getAttribute("data-aliases");
                 if (!aliases) {
                     return;
                 }
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 26aaf0db6f6..985aeedabb1 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/test/rustdoc/auto_aliases.rs b/src/test/rustdoc/auto_aliases.rs
index b8f3527510c..56e0770ab5c 100644
--- a/src/test/rustdoc/auto_aliases.rs
+++ b/src/test/rustdoc/auto_aliases.rs
@@ -1,6 +1,6 @@
 #![feature(auto_traits)]
 
-// @has auto_aliases/trait.Bar.html '//h3[@aliases="auto_aliases::Foo"]' 'impl Bar for Foo'
+// @has auto_aliases/trait.Bar.html '//h3[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo'
 pub struct Foo;
 
 pub auto trait Bar {}
diff --git a/src/test/ui/typeck/issue-75883.rs b/src/test/ui/typeck/issue-75883.rs
new file mode 100644
index 00000000000..3a59ca049ba
--- /dev/null
+++ b/src/test/ui/typeck/issue-75883.rs
@@ -0,0 +1,22 @@
+// Regression test for #75883.
+
+pub struct UI {}
+
+impl UI {
+    pub fn run() -> Result<_> {
+        //~^ ERROR: this enum takes 2 type arguments but only 1 type argument was supplied
+        //~| ERROR: the type placeholder `_` is not allowed within types on item signatures
+        let mut ui = UI {};
+        ui.interact();
+
+        unimplemented!();
+    }
+
+    pub fn interact(&mut self) -> Result<_> {
+        //~^ ERROR: this enum takes 2 type arguments but only 1 type argument was supplied
+        //~| ERROR: the type placeholder `_` is not allowed within types on item signatures
+        unimplemented!();
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/typeck/issue-75883.stderr b/src/test/ui/typeck/issue-75883.stderr
new file mode 100644
index 00000000000..a6b2eb8f972
--- /dev/null
+++ b/src/test/ui/typeck/issue-75883.stderr
@@ -0,0 +1,52 @@
+error[E0107]: this enum takes 2 type arguments but only 1 type argument was supplied
+  --> $DIR/issue-75883.rs:6:21
+   |
+LL |     pub fn run() -> Result<_> {
+   |                     ^^^^^^ - supplied 1 type argument
+   |                     |
+   |                     expected 2 type arguments
+   |
+note: enum defined here, with 2 type parameters: `T`, `E`
+  --> $SRC_DIR/core/src/result.rs:LL:COL
+   |
+LL | pub enum Result<T, E> {
+   |          ^^^^^^ -  -
+help: add missing type argument
+   |
+LL |     pub fn run() -> Result<_, E> {
+   |                             ^^^
+
+error[E0107]: this enum takes 2 type arguments but only 1 type argument was supplied
+  --> $DIR/issue-75883.rs:15:35
+   |
+LL |     pub fn interact(&mut self) -> Result<_> {
+   |                                   ^^^^^^ - supplied 1 type argument
+   |                                   |
+   |                                   expected 2 type arguments
+   |
+note: enum defined here, with 2 type parameters: `T`, `E`
+  --> $SRC_DIR/core/src/result.rs:LL:COL
+   |
+LL | pub enum Result<T, E> {
+   |          ^^^^^^ -  -
+help: add missing type argument
+   |
+LL |     pub fn interact(&mut self) -> Result<_, E> {
+   |                                           ^^^
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/issue-75883.rs:15:42
+   |
+LL |     pub fn interact(&mut self) -> Result<_> {
+   |                                          ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/issue-75883.rs:6:28
+   |
+LL |     pub fn run() -> Result<_> {
+   |                            ^ not allowed in type signatures
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0107, E0121.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/typeck/issue-80779.rs b/src/test/ui/typeck/issue-80779.rs
new file mode 100644
index 00000000000..6791976196f
--- /dev/null
+++ b/src/test/ui/typeck/issue-80779.rs
@@ -0,0 +1,13 @@
+// Regression test for #80779.
+
+pub struct T<'a>(&'a str);
+
+pub fn f<'a>(val: T<'a>) -> _ {
+    //~^ ERROR: the type placeholder `_` is not allowed within types on item signatures
+    g(val)
+}
+
+pub fn g(_: T<'static>) -> _ {}
+//~^ ERROR: the type placeholder `_` is not allowed within types on item signatures
+
+fn main() {}
diff --git a/src/test/ui/typeck/issue-80779.stderr b/src/test/ui/typeck/issue-80779.stderr
new file mode 100644
index 00000000000..aca494520f8
--- /dev/null
+++ b/src/test/ui/typeck/issue-80779.stderr
@@ -0,0 +1,21 @@
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/issue-80779.rs:10:28
+   |
+LL | pub fn g(_: T<'static>) -> _ {}
+   |                            ^
+   |                            |
+   |                            not allowed in type signatures
+   |                            help: replace with the correct return type: `()`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/issue-80779.rs:5:29
+   |
+LL | pub fn f<'a>(val: T<'a>) -> _ {
+   |                             ^
+   |                             |
+   |                             not allowed in type signatures
+   |                             help: replace with the correct return type: `()`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs
index 757d7669bd8..8c74284fa46 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 fa0c5f01430..750a23e8c98 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`.)
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs
index cb84fd8be6f..b14b5aeb572 100644
--- a/src/tools/tidy/src/features.rs
+++ b/src/tools/tidy/src/features.rs
@@ -423,6 +423,15 @@ fn map_lib_features(
                         continue;
                     }};
                 }
+
+                lazy_static::lazy_static! {
+                    static ref COMMENT_LINE: Regex = Regex::new(r"^\s*//").unwrap();
+                }
+                // exclude commented out lines
+                if COMMENT_LINE.is_match(line) {
+                    continue;
+                }
+
                 if let Some((ref name, ref mut f)) = becoming_feature {
                     if f.tracking_issue.is_none() {
                         f.tracking_issue = find_attr_val(line, "issue").and_then(handle_issue_none);