From 32f056ce6b91d6f63dd93f7e82202fa6308e02ee Mon Sep 17 00:00:00 2001
From: Guillaume Gomez <guillaume.gomez@huawei.com>
Date: Mon, 26 Jun 2023 16:32:59 +0200
Subject: [PATCH 1/3] Add/improve code comments

---
 src/librustdoc/clean/mod.rs                         | 2 +-
 src/librustdoc/clean/types.rs                       | 3 +++
 tests/rustdoc/reexport-doc-hidden-inside-private.rs | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index f86c32158e0..625e0d7bd8d 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -2377,7 +2377,7 @@ fn filter_tokens_from_list(
     tokens
 }
 
-/// When inlining items, we merge its attributes (and all the reexports attributes too) with the
+/// When inlining items, we merge their attributes (and all the reexports attributes too) with the
 /// final reexport. For example:
 ///
 /// ```ignore (just an example)
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index 5f5cade67a2..26139d52769 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -956,6 +956,8 @@ pub(crate) trait AttributesExt {
                     .filter_map(|attr| Cfg::parse(attr.meta_item()?).ok())
                     .fold(Cfg::True, |cfg, new_cfg| cfg & new_cfg)
             } else if doc_auto_cfg_active {
+                // If there is no `doc(cfg())`, then we retrieve the `cfg()` attributes (because
+                // `doc(cfg())` overrides `cfg()`).
                 self.iter()
                     .filter(|attr| attr.has_name(sym::cfg))
                     .filter_map(|attr| single(attr.meta_item_list()?))
@@ -2387,6 +2389,7 @@ impl ImplKind {
 #[derive(Clone, Debug)]
 pub(crate) struct Import {
     pub(crate) kind: ImportKind,
+    /// The item being re-exported.
     pub(crate) source: ImportSource,
     pub(crate) should_be_displayed: bool,
 }
diff --git a/tests/rustdoc/reexport-doc-hidden-inside-private.rs b/tests/rustdoc/reexport-doc-hidden-inside-private.rs
index 1e4216d3c0c..e9d243d8abf 100644
--- a/tests/rustdoc/reexport-doc-hidden-inside-private.rs
+++ b/tests/rustdoc/reexport-doc-hidden-inside-private.rs
@@ -1,4 +1,4 @@
-// This test ensures that a re-export of  `#[doc(hidden)]` item inside a private
+// This test ensures that a re-export of `#[doc(hidden)]` item inside a private
 // module will still be displayed (the re-export, not the item).
 
 #![crate_name = "foo"]

From 20c46f0ef17fb1f3b7527663d69a381b6e3f08f3 Mon Sep 17 00:00:00 2001
From: Eric Huss <eric@huss.org>
Date: Mon, 26 Jun 2023 09:44:26 -0700
Subject: [PATCH 2/3] Update books

---
 src/doc/book            | 2 +-
 src/doc/nomicon         | 2 +-
 src/doc/reference       | 2 +-
 src/doc/rust-by-example | 2 +-
 src/doc/rustc-dev-guide | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/doc/book b/src/doc/book
index 8fa6b854d51..21cf840842b 160000
--- a/src/doc/book
+++ b/src/doc/book
@@ -1 +1 @@
-Subproject commit 8fa6b854d515506d825390fe0d817f5ef0c89350
+Subproject commit 21cf840842bdf768a798869f06373c96c1cc5122
diff --git a/src/doc/nomicon b/src/doc/nomicon
index b5f018fb593..c369e4b4893 160000
--- a/src/doc/nomicon
+++ b/src/doc/nomicon
@@ -1 +1 @@
-Subproject commit b5f018fb5930cb733b0a8aaf2eed975d4771e74d
+Subproject commit c369e4b489332f8721fbae630354fa83385d457d
diff --git a/src/doc/reference b/src/doc/reference
index 553d99b02a5..5ca365eac67 160000
--- a/src/doc/reference
+++ b/src/doc/reference
@@ -1 +1 @@
-Subproject commit 553d99b02a53b4133a40d5bd2e19958c67487c00
+Subproject commit 5ca365eac678cb0d41a20b3204546d6ed70c7171
diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example
index 8ee9528b72b..57636d69267 160000
--- a/src/doc/rust-by-example
+++ b/src/doc/rust-by-example
@@ -1 +1 @@
-Subproject commit 8ee9528b72b927cff8fd32346db8bbd1198816f0
+Subproject commit 57636d6926762861f34e030d52ca25a71e95e5bf
diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide
index f1e637883fa..17fe3e94849 160000
--- a/src/doc/rustc-dev-guide
+++ b/src/doc/rustc-dev-guide
@@ -1 +1 @@
-Subproject commit f1e637883fafeb83bdd5906ee7f467e4d35b7337
+Subproject commit 17fe3e948498c50e208047a750f17d6a8d89669b

From c6e6ceb078f57519bf246eba791dc20aa007948a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= <matthias.krueger@famsik.de>
Date: Sun, 25 Jun 2023 23:16:00 +0200
Subject: [PATCH 3/3] make custom mir ICE a bit nicer

---
 compiler/rustc_mir_build/src/build/custom/mod.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compiler/rustc_mir_build/src/build/custom/mod.rs b/compiler/rustc_mir_build/src/build/custom/mod.rs
index 32c618828c9..e5c2cc6c7bb 100644
--- a/compiler/rustc_mir_build/src/build/custom/mod.rs
+++ b/compiler/rustc_mir_build/src/build/custom/mod.rs
@@ -118,7 +118,11 @@ fn parse_attribute(attr: &Attribute) -> MirPhase {
                 phase = Some(value);
             }
             other => {
-                panic!("Unexpected key {}", other);
+                span_bug!(
+                    nested.span(),
+                    "Unexpected key while parsing custom_mir attribute: '{}'",
+                    other
+                );
             }
         }
     }