From f9db3c243bae6c0618f83a36520b3fa7e726d693 Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sat, 29 Feb 2020 03:22:18 +0900
Subject: [PATCH 1/3] Clean up unstable book

---
 .../language-features/const-in-array-repeat-expressions.md | 2 +-
 .../src/language-features/impl-trait-in-bindings.md        | 4 ++--
 src/doc/unstable-book/src/language-features/link-cfg.md    | 5 +++++
 src/doc/unstable-book/src/language-features/trait-alias.md | 2 +-
 .../src/language-features/transparent-unions.md            | 2 +-
 .../unstable-book/src/library-features/read-initializer.md | 7 -------
 .../library-features/tidy-test-never-used-anywhere-else.md | 5 +++++
 7 files changed, 15 insertions(+), 12 deletions(-)
 create mode 100644 src/doc/unstable-book/src/language-features/link-cfg.md
 delete mode 100644 src/doc/unstable-book/src/library-features/read-initializer.md
 create mode 100644 src/doc/unstable-book/src/library-features/tidy-test-never-used-anywhere-else.md

diff --git a/src/doc/unstable-book/src/language-features/const-in-array-repeat-expressions.md b/src/doc/unstable-book/src/language-features/const-in-array-repeat-expressions.md
index 09d1b19b4c3c3..940916944bdaa 100644
--- a/src/doc/unstable-book/src/language-features/const-in-array-repeat-expressions.md
+++ b/src/doc/unstable-book/src/language-features/const-in-array-repeat-expressions.md
@@ -2,7 +2,7 @@
 
 The tracking issue for this feature is: [#49147]
 
-[#44109]: https://github.com/rust-lang/rust/issues/49147
+[#49147]: https://github.com/rust-lang/rust/issues/49147
 
 ------------------------
 
diff --git a/src/doc/unstable-book/src/language-features/impl-trait-in-bindings.md b/src/doc/unstable-book/src/language-features/impl-trait-in-bindings.md
index 896465cf64978..5c6aa912c1b24 100644
--- a/src/doc/unstable-book/src/language-features/impl-trait-in-bindings.md
+++ b/src/doc/unstable-book/src/language-features/impl-trait-in-bindings.md
@@ -1,8 +1,8 @@
 # `impl_trait_in_bindings`
 
-The tracking issue for this feature is: [#34511]
+The tracking issue for this feature is: [#63065]
 
-[#34511]: https://github.com/rust-lang/rust/issues/34511
+[#63065]: https://github.com/rust-lang/rust/issues/63065
 
 ------------------------
 
diff --git a/src/doc/unstable-book/src/language-features/link-cfg.md b/src/doc/unstable-book/src/language-features/link-cfg.md
new file mode 100644
index 0000000000000..ee0fd5bf8698c
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/link-cfg.md
@@ -0,0 +1,5 @@
+# `link_cfg`
+
+This feature is internal to the Rust compiler and is not intended for general use.
+
+------------------------
diff --git a/src/doc/unstable-book/src/language-features/trait-alias.md b/src/doc/unstable-book/src/language-features/trait-alias.md
index 4f2db040160c3..f1be053ddc42e 100644
--- a/src/doc/unstable-book/src/language-features/trait-alias.md
+++ b/src/doc/unstable-book/src/language-features/trait-alias.md
@@ -2,7 +2,7 @@
 
 The tracking issue for this feature is: [#41517]
 
-[#41417]: https://github.com/rust-lang/rust/issues/41517
+[#41517]: https://github.com/rust-lang/rust/issues/41517
 
 ------------------------
 
diff --git a/src/doc/unstable-book/src/language-features/transparent-unions.md b/src/doc/unstable-book/src/language-features/transparent-unions.md
index b731c9ea6d012..9b39b8971644f 100644
--- a/src/doc/unstable-book/src/language-features/transparent-unions.md
+++ b/src/doc/unstable-book/src/language-features/transparent-unions.md
@@ -2,7 +2,7 @@
 
 The tracking issue for this feature is [#60405]
 
-[60405]: https://github.com/rust-lang/rust/issues/60405
+[#60405]: https://github.com/rust-lang/rust/issues/60405
 
 ----
 
diff --git a/src/doc/unstable-book/src/library-features/read-initializer.md b/src/doc/unstable-book/src/library-features/read-initializer.md
deleted file mode 100644
index 898fe58eeee53..0000000000000
--- a/src/doc/unstable-book/src/library-features/read-initializer.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# `read_initializer`
-
-The tracking issue for this feature is: [#42788]
-
-[#0]: https://github.com/rust-lang/rust/issues/42788
-
-------------------------
diff --git a/src/doc/unstable-book/src/library-features/tidy-test-never-used-anywhere-else.md b/src/doc/unstable-book/src/library-features/tidy-test-never-used-anywhere-else.md
new file mode 100644
index 0000000000000..c194d79a19d3e
--- /dev/null
+++ b/src/doc/unstable-book/src/library-features/tidy-test-never-used-anywhere-else.md
@@ -0,0 +1,5 @@
+# `tidy_test_never_used_anywhere_else`
+
+This feature is internal to the Rust compiler and is not intended for general use.
+
+------------------------

From 4c9e87e989bd15bde318e4a03836591658826445 Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sat, 29 Feb 2020 23:29:46 +0900
Subject: [PATCH 2/3] Stop generating `compiler_builtins_lib` doc

---
 src/tools/tidy/src/features.rs      | 14 --------------
 src/tools/tidy/src/unstable_book.rs | 18 ++----------------
 2 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs
index 12f93a87cb172..d9320e9147cff 100644
--- a/src/tools/tidy/src/features.rs
+++ b/src/tools/tidy/src/features.rs
@@ -63,20 +63,6 @@ pub struct CollectedFeatures {
 pub fn collect_lib_features(base_src_path: &Path) -> Features {
     let mut lib_features = Features::new();
 
-    // This library feature is defined in the `compiler_builtins` crate, which
-    // has been moved out-of-tree. Now it can no longer be auto-discovered by
-    // `tidy`, because we need to filter out its (submodule) directory. Manually
-    // add it to the set of known library features so we can still generate docs.
-    lib_features.insert(
-        "compiler_builtins_lib".to_owned(),
-        Feature {
-            level: Status::Unstable,
-            since: None,
-            has_gate_test: false,
-            tracking_issue: None,
-        },
-    );
-
     map_lib_features(base_src_path, &mut |res, _, _| {
         if let Ok((name, feature)) = res {
             lib_features.insert(name.to_owned(), feature);
diff --git a/src/tools/tidy/src/unstable_book.rs b/src/tools/tidy/src/unstable_book.rs
index 472d66459d724..7dfb6224d240a 100644
--- a/src/tools/tidy/src/unstable_book.rs
+++ b/src/tools/tidy/src/unstable_book.rs
@@ -1,4 +1,4 @@
-use crate::features::{CollectedFeatures, Feature, Features, Status};
+use crate::features::{CollectedFeatures, Features, Status};
 use std::collections::BTreeSet;
 use std::fs;
 use std::path::{Path, PathBuf};
@@ -73,26 +73,12 @@ fn collect_unstable_book_lib_features_section_file_names(base_src_path: &Path) -
 
 pub fn check(path: &Path, features: CollectedFeatures, bad: &mut bool) {
     let lang_features = features.lang;
-    let mut lib_features = features
+    let lib_features = features
         .lib
         .into_iter()
         .filter(|&(ref name, _)| !lang_features.contains_key(name))
         .collect::<Features>();
 
-    // This library feature is defined in the `compiler_builtins` crate, which
-    // has been moved out-of-tree. Now it can no longer be auto-discovered by
-    // `tidy`, because we need to filter out its (submodule) directory. Manually
-    // add it to the set of known library features so we can still generate docs.
-    lib_features.insert(
-        "compiler_builtins_lib".to_owned(),
-        Feature {
-            level: Status::Unstable,
-            since: None,
-            has_gate_test: false,
-            tracking_issue: None,
-        },
-    );
-
     // Library features
     let unstable_lib_feature_names = collect_unstable_feature_names(&lib_features);
     let unstable_book_lib_features_section_file_names =

From c55df3786a944e10615075184a507554cf7d7c39 Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sun, 1 Mar 2020 00:35:49 +0900
Subject: [PATCH 3/3] Make `rustc_attrs` tracking issue None

---
 src/librustc_feature/active.rs                              | 6 +++---
 .../min_const_fn/allow_const_fn_ptr_feature_gate.stderr     | 1 -
 src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr | 3 ---
 src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr   | 4 ----
 .../on-unimplemented/feature-gate-on-unimplemented.stderr   | 1 -
 src/test/ui/proc-macro/expand-to-unstable-2.stderr          | 1 -
 src/test/ui/reserved/reserved-attr-on-macro.stderr          | 1 -
 src/test/ui/suggestions/attribute-typos.stderr              | 1 -
 src/test/ui/tool-attributes/diagnostic_item.stderr          | 1 -
 9 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/src/librustc_feature/active.rs b/src/librustc_feature/active.rs
index 0082f4f1a6e89..380dfc4a0673f 100644
--- a/src/librustc_feature/active.rs
+++ b/src/librustc_feature/active.rs
@@ -99,6 +99,9 @@ declare_features! (
 
     // no-tracking-issue-start
 
+    /// Allows using `rustc_*` attributes (RFC 572).
+    (active, rustc_attrs, "1.0.0", None, None),
+
     /// Allows using compiler's own crates.
     (active, rustc_private, "1.0.0", Some(27812), None),
 
@@ -128,9 +131,6 @@ declare_features! (
     /// Allows using `#[link_name="llvm.*"]`.
     (active, link_llvm_intrinsics, "1.0.0", Some(29602), None),
 
-    /// Allows using `rustc_*` attributes (RFC 572).
-    (active, rustc_attrs, "1.0.0", Some(29642), None),
-
     /// Allows using the `box $expr` syntax.
     (active, box_syntax, "1.0.0", Some(49733), None),
 
diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr
index c8d060f5cdcfe..7794cc7583dfc 100644
--- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr
+++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr
@@ -4,7 +4,6 @@ error[E0658]: internal implementation detail
 LL | #[rustc_allow_const_fn_ptr]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: aborting due to previous error
diff --git a/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr b/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr
index 082d897c01dc1..82dec1fd4cf21 100644
--- a/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr
+++ b/src/test/ui/feature-gates/feature-gate-rustc-attrs-1.stderr
@@ -4,7 +4,6 @@ error[E0658]: the `#[rustc_variance]` attribute is just used for rustc unit test
 LL | #[rustc_variance]
    | ^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error[E0658]: the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable
@@ -13,7 +12,6 @@ error[E0658]: the `#[rustc_error]` attribute is just used for rustc unit tests a
 LL | #[rustc_error]
    | ^^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error[E0658]: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable niche optimizations in libcore and will never be stable
@@ -22,7 +20,6 @@ error[E0658]: the `#[rustc_nonnull_optimization_guaranteed]` attribute is just u
 LL | #[rustc_nonnull_optimization_guaranteed]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: aborting due to 3 previous errors
diff --git a/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr b/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
index 58f8b4e703513..1e039f17a0d11 100644
--- a/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
+++ b/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
@@ -4,7 +4,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
 LL | #[rustc::unknown]
    |   ^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: expected attribute, found macro `rustc::unknown`
@@ -19,7 +18,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
 LL | #[unknown::rustc]
    |            ^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: expected attribute, found macro `unknown::rustc`
@@ -34,7 +32,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
 LL | #[rustc_unknown]
    |   ^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: cannot find attribute `rustc_unknown` in this scope
@@ -49,7 +46,6 @@ error[E0658]: the `#[rustc_dummy]` attribute is just used for rustc unit tests a
 LL | #[rustc_dummy]
    | ^^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: aborting due to 7 previous errors
diff --git a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr b/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr
index 71baf92b2d409..a4b33963fb0b9 100644
--- a/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr
+++ b/src/test/ui/on-unimplemented/feature-gate-on-unimplemented.stderr
@@ -4,7 +4,6 @@ error[E0658]: this is an internal attribute that will never be stable
 LL | #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}`"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: aborting due to previous error
diff --git a/src/test/ui/proc-macro/expand-to-unstable-2.stderr b/src/test/ui/proc-macro/expand-to-unstable-2.stderr
index ff2e3af3777a1..19144b210a127 100644
--- a/src/test/ui/proc-macro/expand-to-unstable-2.stderr
+++ b/src/test/ui/proc-macro/expand-to-unstable-2.stderr
@@ -4,7 +4,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
 LL | #[derive(Unstable)]
    |          ^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
    = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/src/test/ui/reserved/reserved-attr-on-macro.stderr b/src/test/ui/reserved/reserved-attr-on-macro.stderr
index 2870cb57e9caf..c387bba0a1310 100644
--- a/src/test/ui/reserved/reserved-attr-on-macro.stderr
+++ b/src/test/ui/reserved/reserved-attr-on-macro.stderr
@@ -4,7 +4,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
 LL | #[rustc_attribute_should_be_reserved]
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: cannot determine resolution for the macro `foo`
diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr
index 10a119a628c70..c7c257ba5fe53 100644
--- a/src/test/ui/suggestions/attribute-typos.stderr
+++ b/src/test/ui/suggestions/attribute-typos.stderr
@@ -4,7 +4,6 @@ error[E0658]: attributes starting with `rustc` are reserved for use by the `rust
 LL | #[rustc_err]
    |   ^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: cannot find attribute `rustc_err` in this scope
diff --git a/src/test/ui/tool-attributes/diagnostic_item.stderr b/src/test/ui/tool-attributes/diagnostic_item.stderr
index d12834084e714..743e4b658c6b7 100644
--- a/src/test/ui/tool-attributes/diagnostic_item.stderr
+++ b/src/test/ui/tool-attributes/diagnostic_item.stderr
@@ -4,7 +4,6 @@ error[E0658]: diagnostic items compiler internal support for linting
 LL | #[rustc_diagnostic_item = "foomp"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #29642 <https://github.com/rust-lang/rust/issues/29642> for more information
    = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
 
 error: aborting due to previous error