From 36f8d67c9206407bcd79974a640c760d168b75c6 Mon Sep 17 00:00:00 2001
From: Zalathar <Zalathar@users.noreply.github.com>
Date: Sun, 17 Mar 2024 13:46:54 +1100
Subject: [PATCH 01/13] Mention Zalathar for coverage changes

---
 triagebot.toml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/triagebot.toml b/triagebot.toml
index 515600793da..0a36eab7b87 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -726,6 +726,30 @@ cc = ["@rust-lang/project-exploit-mitigations", "@rcvalle"]
 [mentions."tests/ui/check-cfg"]
 cc = ["@Urgau"]
 
+[mentions."compiler/rustc_middle/src/mir/coverage.rs"]
+message = "Some changes occurred in coverage instrumentation."
+cc = ["@Zalathar"]
+
+[mentions."compiler/rustc_mir_build/src/build/coverageinfo.rs"]
+message = "Some changes occurred in coverage instrumentation."
+cc = ["@Zalathar"]
+
+[mentions."compiler/rustc_mir_transform/src/coverage"]
+message = "Some changes occurred in coverage instrumentation."
+cc = ["@Zalathar"]
+
+[mentions."compiler/rustc_codegen_llvm/src/coverageinfo"]
+message = "Some changes occurred in coverage instrumentation."
+cc = ["@Zalathar"]
+
+[mentions."compiler/rustc_codegen_ssa/src/mir/coverageinfo.rs"]
+message = "Some changes occurred in coverage instrumentation."
+cc = ["@Zalathar"]
+
+[mentions."tests/coverage"]
+message = "Some changes occurred in coverage tests."
+cc = ["@Zalathar"]
+
 [assign]
 warn_non_default_branch = true
 contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"

From 0437a0c372be237b6796ac0791d5f0c828aa8b42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= <matthias.krueger@famsik.de>
Date: Sun, 17 Mar 2024 13:37:54 +0100
Subject: [PATCH 02/13] some minor code simplifications

---
 compiler/rustc_hir_typeck/src/callee.rs                   | 2 +-
 .../rustc_mir_transform/src/coverage/spans/from_mir.rs    | 5 ++---
 compiler/rustc_session/src/config.rs                      | 8 +-------
 src/librustdoc/clean/mod.rs                               | 2 +-
 src/librustdoc/clean/utils.rs                             | 2 +-
 src/librustdoc/html/render/mod.rs                         | 4 ++--
 6 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs
index 25d34531379..9a500fa712b 100644
--- a/compiler/rustc_hir_typeck/src/callee.rs
+++ b/compiler/rustc_hir_typeck/src/callee.rs
@@ -755,7 +755,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
         if let hir::ExprKind::Path(hir::QPath::Resolved(None, path)) = callee_expr.kind
             && let Res::Local(_) = path.res
-            && let [segment] = &path.segments[..]
+            && let [segment] = &path.segments
         {
             for id in self.tcx.hir().items() {
                 if let Some(node) = self.tcx.hir().get_if_local(id.owner_id.into())
diff --git a/compiler/rustc_mir_transform/src/coverage/spans/from_mir.rs b/compiler/rustc_mir_transform/src/coverage/spans/from_mir.rs
index 86097bdcd95..3f6a4156044 100644
--- a/compiler/rustc_mir_transform/src/coverage/spans/from_mir.rs
+++ b/compiler/rustc_mir_transform/src/coverage/spans/from_mir.rs
@@ -401,9 +401,8 @@ pub(super) fn extract_branch_mappings(
             }
             let (span, _) = unexpand_into_body_span_with_visible_macro(raw_span, body_span)?;
 
-            let bcb_from_marker = |marker: BlockMarkerId| {
-                Some(basic_coverage_blocks.bcb_from_bb(block_markers[marker]?)?)
-            };
+            let bcb_from_marker =
+                |marker: BlockMarkerId| basic_coverage_blocks.bcb_from_bb(block_markers[marker]?);
 
             let true_bcb = bcb_from_marker(true_marker)?;
             let false_bcb = bcb_from_marker(false_marker)?;
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index b7ee2c98025..e56684808bb 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -144,18 +144,12 @@ pub enum InstrumentCoverage {
 }
 
 /// Individual flag values controlled by `-Z coverage-options`.
-#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
 pub struct CoverageOptions {
     /// Add branch coverage instrumentation.
     pub branch: bool,
 }
 
-impl Default for CoverageOptions {
-    fn default() -> Self {
-        Self { branch: false }
-    }
-}
-
 /// Settings for `-Z instrument-xray` flag.
 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
 pub struct InstrumentXRay {
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index dfc026fe50b..855fb132fc8 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -1572,7 +1572,7 @@ fn first_non_private<'tcx>(
     path: &hir::Path<'tcx>,
 ) -> Option<Path> {
     let target_def_id = path.res.opt_def_id()?;
-    let (parent_def_id, ident) = match &path.segments[..] {
+    let (parent_def_id, ident) = match &path.segments {
         [] => return None,
         // Relative paths are available in the same scope as the owner.
         [leaf] => (cx.tcx.local_parent(hir_id.owner.def_id), leaf.ident),
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs
index 0b20cca3bca..365d63d9657 100644
--- a/src/librustdoc/clean/utils.rs
+++ b/src/librustdoc/clean/utils.rs
@@ -598,7 +598,7 @@ pub(crate) fn has_doc_flag(tcx: TyCtxt<'_>, did: DefId, flag: Symbol) -> bool {
 /// Set by `bootstrap::Builder::doc_rust_lang_org_channel` in order to keep tests passing on beta/stable.
 pub(crate) const DOC_RUST_LANG_ORG_CHANNEL: &str = env!("DOC_RUST_LANG_ORG_CHANNEL");
 pub(crate) static DOC_CHANNEL: Lazy<&'static str> =
-    Lazy::new(|| DOC_RUST_LANG_ORG_CHANNEL.rsplit('/').filter(|c| !c.is_empty()).next().unwrap());
+    Lazy::new(|| DOC_RUST_LANG_ORG_CHANNEL.rsplit('/').find(|c| !c.is_empty()).unwrap());
 
 /// Render a sequence of macro arms in a format suitable for displaying to the user
 /// as part of an item declaration.
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 6c5040414bc..f1887684797 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -150,13 +150,13 @@ impl RenderType {
             string.push('{');
             write_optional_id(self.id, string);
             string.push('{');
-            for generic in &self.generics.as_ref().map(Vec::as_slice).unwrap_or_default()[..] {
+            for generic in &self.generics.as_deref().unwrap_or_default()[..] {
                 generic.write_to_string(string);
             }
             string.push('}');
             if self.bindings.is_some() {
                 string.push('{');
-                for binding in &self.bindings.as_ref().map(Vec::as_slice).unwrap_or_default()[..] {
+                for binding in &self.bindings.as_deref().unwrap_or_default()[..] {
                     string.push('{');
                     binding.0.write_to_string(string);
                     string.push('{');

From fefd06dc02eea5c5bd96aedce17a5e58c8645f9a Mon Sep 17 00:00:00 2001
From: The 8472 <git@infinite-source.de>
Date: Fri, 15 Mar 2024 22:25:00 +0100
Subject: [PATCH 03/13] add test for #122301 to cover behavior that's on stable

if this ought to be broken it should at least happen intentionally
---
 .../control-flow/dead_branches_dont_eval.rs   | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 tests/ui/consts/control-flow/dead_branches_dont_eval.rs

diff --git a/tests/ui/consts/control-flow/dead_branches_dont_eval.rs b/tests/ui/consts/control-flow/dead_branches_dont_eval.rs
new file mode 100644
index 00000000000..374349732f9
--- /dev/null
+++ b/tests/ui/consts/control-flow/dead_branches_dont_eval.rs
@@ -0,0 +1,46 @@
+//@ build-pass
+
+// issue 122301 - currently the only way to supress
+// const eval and codegen of code conditional on some other const
+
+struct Foo<T, const N: usize>(T);
+
+impl<T, const N: usize> Foo<T, N> {
+    const BAR: () = if N == 0 {
+        panic!()
+    };
+}
+
+struct Invoke<T, const N: usize>(T);
+
+impl<T, const N: usize> Invoke<T, N> {
+    const FUN: fn() = if N != 0 {
+        || Foo::<T, N>::BAR
+    } else {
+        || {}
+    };
+}
+
+// without closures
+
+struct S<T>(T);
+impl<T> S<T> {
+    const C: () = panic!();
+}
+
+const fn bar<T>() { S::<T>::C }
+
+struct ConstIf<T, const N: usize>(T);
+
+impl<T, const N: usize> ConstIf<T, N> {
+    const VAL: () = if N != 0 {
+        bar::<T>() // not called for N == 0, and hence not monomorphized
+    } else {
+        ()
+    };
+}
+
+fn main() {
+    let _val = Invoke::<(), 0>::FUN();
+    let _val = ConstIf::<(), 0>::VAL;
+}

From 772d8598d2a2d1b27f090dc2cbaf7f950b9ad4be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?=
 <jieyouxu@outlook.com>
Date: Sat, 16 Mar 2024 02:38:42 +0000
Subject: [PATCH 04/13] Only invoke `decorate` if the diag can eventually be
 emitted

---
 compiler/rustc_middle/src/lint.rs          | 12 ++++++++++--
 tests/ui/lint/decorate-def-path-str-ice.rs | 14 ++++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 tests/ui/lint/decorate-def-path-str-ice.rs

diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs
index d8d6899f057..b83793df641 100644
--- a/compiler/rustc_middle/src/lint.rs
+++ b/compiler/rustc_middle/src/lint.rs
@@ -398,8 +398,16 @@ pub fn lint_level(
             }
         }
 
-        // Finally, run `decorate`.
-        decorate(&mut err);
+        // Finally, run `decorate`. This is guarded by a `can_emit_warnings()` check so that any
+        // `def_path_str` called within `decorate` won't trigger a `must_produce_diag` ICE if the
+        // `err` isn't eventually emitted (e.g. due to `-A warnings`). If an `err` is force-warn,
+        // it's going to be emitted anyway.
+        if matches!(err_level, rustc_errors::Level::ForceWarning(_))
+            || sess.dcx().can_emit_warnings()
+        {
+            decorate(&mut err);
+        }
+
         explain_lint_level_source(lint, level, src, &mut err);
         err.emit()
     }
diff --git a/tests/ui/lint/decorate-def-path-str-ice.rs b/tests/ui/lint/decorate-def-path-str-ice.rs
new file mode 100644
index 00000000000..176f66ba1f4
--- /dev/null
+++ b/tests/ui/lint/decorate-def-path-str-ice.rs
@@ -0,0 +1,14 @@
+// Checks that compiling this file with
+// `-Dunused_must_use -Awarnings --cap-lints=warn --crate-type=lib` does not ICE when emitting
+// diagnostics.
+// Issue: <https://github.com/rust-lang/rust/issues/121774>.
+
+//@ compile-flags: -Dunused_must_use -Awarnings --cap-lints=warn --crate-type=lib
+//@ check-pass
+
+#[must_use]
+fn f() {}
+
+pub fn g() {
+    f();
+}

From 60de7554de5537bfaf359905ec2c1fad60f9cfbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?=
 <jieyouxu@outlook.com>
Date: Sat, 16 Mar 2024 14:36:03 +0000
Subject: [PATCH 05/13] Invoke decorate when error level is beyond warning,
 including error

---
 compiler/rustc_middle/src/lint.rs             | 23 +++++++++-----
 tests/ui/lint/decorate-def-path-str-ice.rs    | 14 ---------
 .../decorate-can-emit-warnings.rs             | 11 +++++++
 .../decorate-can-emit-warnings.stderr         | 14 +++++++++
 .../decorate-ice/decorate-def-path-str-ice.rs | 30 +++++++++++++++++++
 .../lint/decorate-ice/decorate-force-warn.rs  | 13 ++++++++
 .../decorate-ice/decorate-force-warn.stderr   | 14 +++++++++
 7 files changed, 98 insertions(+), 21 deletions(-)
 delete mode 100644 tests/ui/lint/decorate-def-path-str-ice.rs
 create mode 100644 tests/ui/lint/decorate-ice/decorate-can-emit-warnings.rs
 create mode 100644 tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr
 create mode 100644 tests/ui/lint/decorate-ice/decorate-def-path-str-ice.rs
 create mode 100644 tests/ui/lint/decorate-ice/decorate-force-warn.rs
 create mode 100644 tests/ui/lint/decorate-ice/decorate-force-warn.stderr

diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs
index b83793df641..b5b22e3f4b7 100644
--- a/compiler/rustc_middle/src/lint.rs
+++ b/compiler/rustc_middle/src/lint.rs
@@ -398,14 +398,23 @@ pub fn lint_level(
             }
         }
 
-        // Finally, run `decorate`. This is guarded by a `can_emit_warnings()` check so that any
-        // `def_path_str` called within `decorate` won't trigger a `must_produce_diag` ICE if the
-        // `err` isn't eventually emitted (e.g. due to `-A warnings`). If an `err` is force-warn,
-        // it's going to be emitted anyway.
-        if matches!(err_level, rustc_errors::Level::ForceWarning(_))
-            || sess.dcx().can_emit_warnings()
+        // Finally, run `decorate`. `decorate` can call `trimmed_path_str` (directly or indirectly),
+        // so we need to make sure when we do call `decorate` that the diagnostic is eventually
+        // emitted or we'll get a `must_produce_diag` ICE.
+        //
+        // When is a diagnostic *eventually* emitted? Well, that is determined by 2 factors:
+        // 1. If the corresponding `rustc_errors::Level` is beyond warning, i.e. `ForceWarning(_)`
+        //    or `Error`, then the diagnostic will be emitted regardless of CLI options.
+        // 2. If the corresponding `rustc_errors::Level` is warning, then that can be affected by
+        //    `-A warnings` or `--cap-lints=xxx` on the command line. In which case, the diagnostic
+        //    will be emitted if `can_emit_warnings` is true.
         {
-            decorate(&mut err);
+            use rustc_errors::Level as ELevel;
+            if matches!(err_level, ELevel::ForceWarning(_) | ELevel::Error)
+                || sess.dcx().can_emit_warnings()
+            {
+                decorate(&mut err);
+            }
         }
 
         explain_lint_level_source(lint, level, src, &mut err);
diff --git a/tests/ui/lint/decorate-def-path-str-ice.rs b/tests/ui/lint/decorate-def-path-str-ice.rs
deleted file mode 100644
index 176f66ba1f4..00000000000
--- a/tests/ui/lint/decorate-def-path-str-ice.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Checks that compiling this file with
-// `-Dunused_must_use -Awarnings --cap-lints=warn --crate-type=lib` does not ICE when emitting
-// diagnostics.
-// Issue: <https://github.com/rust-lang/rust/issues/121774>.
-
-//@ compile-flags: -Dunused_must_use -Awarnings --cap-lints=warn --crate-type=lib
-//@ check-pass
-
-#[must_use]
-fn f() {}
-
-pub fn g() {
-    f();
-}
diff --git a/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.rs b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.rs
new file mode 100644
index 00000000000..5adb5f526dc
--- /dev/null
+++ b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.rs
@@ -0,0 +1,11 @@
+// Checks that the following does not ICE because `decorate` is incorrectly skipped.
+
+//@ compile-flags: -Dunused_must_use -Awarnings --crate-type=lib
+
+#[must_use]
+fn f() {}
+
+pub fn g() {
+    f();
+    //~^ ERROR unused return value
+}
diff --git a/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr
new file mode 100644
index 00000000000..fde81de6136
--- /dev/null
+++ b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr
@@ -0,0 +1,14 @@
+error: unused return value of `f` that must be used
+  --> $DIR/decorate-can-emit-warnings.rs:9:5
+   |
+LL |     f();
+   |     ^^^
+   |
+   = note: requested on the command line with `-D unused-must-use`
+help: use `let _ = ...` to ignore the resulting value
+   |
+LL |     let _ = f();
+   |     +++++++
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/lint/decorate-ice/decorate-def-path-str-ice.rs b/tests/ui/lint/decorate-ice/decorate-def-path-str-ice.rs
new file mode 100644
index 00000000000..8116e36ed0d
--- /dev/null
+++ b/tests/ui/lint/decorate-ice/decorate-def-path-str-ice.rs
@@ -0,0 +1,30 @@
+// Checks that the following does not ICE.
+//
+// Previously, this test ICEs when the `unused_must_use` lint is suppressed via the combination of
+// `-A warnings` and `--cap-lints=warn`, because:
+//
+// - Its lint diagnostic struct `UnusedDef` implements `LintDiagnostic` manually and in the impl
+//   `def_path_str` was called (which calls `trimmed_def_path`, which will produce a
+//   `must_produce_diag` ICE if a trimmed def path is constructed but never emitted in a diagnostic
+//   because it is expensive to compute).
+// - A `LintDiagnostic` has a `decorate_lint` method which decorates a `Diag` with lint-specific
+//   information. This method is wrapped by a `decorate` closure in `TyCtxt` diagnostic emission
+//   machinery, and the `decorate` closure called as late as possible.
+// - `decorate`'s invocation is delayed as late as possible until `lint_level` is called.
+// - If a lint's corresponding diagnostic is suppressed (to be effectively allow at the final
+//   emission time) via `-A warnings` or `--cap-lints=allow` (or `-A warnings` + `--cap-lints=warn`
+//   like in this test case), `decorate` is still called and a diagnostic is still constructed --
+//   but the diagnostic is never eventually emitted, triggering the aforementioned
+//   `must_produce_diag` ICE due to use of `trimmed_def_path`.
+//
+// Issue: <https://github.com/rust-lang/rust/issues/121774>.
+
+//@ compile-flags: -Dunused_must_use -Awarnings --cap-lints=warn --crate-type=lib
+//@ check-pass
+
+#[must_use]
+fn f() {}
+
+pub fn g() {
+    f();
+}
diff --git a/tests/ui/lint/decorate-ice/decorate-force-warn.rs b/tests/ui/lint/decorate-ice/decorate-force-warn.rs
new file mode 100644
index 00000000000..e33210ed0ce
--- /dev/null
+++ b/tests/ui/lint/decorate-ice/decorate-force-warn.rs
@@ -0,0 +1,13 @@
+// Checks that the following does not ICE because `decorate` is incorrectly skipped due to
+// `--force-warn`.
+
+//@ compile-flags: -Dunused_must_use -Awarnings --force-warn unused_must_use --crate-type=lib
+//@ check-pass
+
+#[must_use]
+fn f() {}
+
+pub fn g() {
+    f();
+    //~^ WARN unused return value
+}
diff --git a/tests/ui/lint/decorate-ice/decorate-force-warn.stderr b/tests/ui/lint/decorate-ice/decorate-force-warn.stderr
new file mode 100644
index 00000000000..5e6b74d414b
--- /dev/null
+++ b/tests/ui/lint/decorate-ice/decorate-force-warn.stderr
@@ -0,0 +1,14 @@
+warning: unused return value of `f` that must be used
+  --> $DIR/decorate-force-warn.rs:11:5
+   |
+LL |     f();
+   |     ^^^
+   |
+   = note: requested on the command line with `--force-warn unused-must-use`
+help: use `let _ = ...` to ignore the resulting value
+   |
+LL |     let _ = f();
+   |     +++++++
+
+warning: 1 warning emitted
+

From bdab02ca994eebd8b4a964793d2684fc87c11119 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?=
 <jieyouxu@outlook.com>
Date: Sun, 17 Mar 2024 15:07:22 +0000
Subject: [PATCH 06/13] Guard decorate on when not to skip instead

---
 compiler/rustc_middle/src/lint.rs | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs
index b5b22e3f4b7..8d9e0dfd869 100644
--- a/compiler/rustc_middle/src/lint.rs
+++ b/compiler/rustc_middle/src/lint.rs
@@ -408,13 +408,10 @@ pub fn lint_level(
         // 2. If the corresponding `rustc_errors::Level` is warning, then that can be affected by
         //    `-A warnings` or `--cap-lints=xxx` on the command line. In which case, the diagnostic
         //    will be emitted if `can_emit_warnings` is true.
-        {
-            use rustc_errors::Level as ELevel;
-            if matches!(err_level, ELevel::ForceWarning(_) | ELevel::Error)
-                || sess.dcx().can_emit_warnings()
-            {
-                decorate(&mut err);
-            }
+        let skip = err_level == rustc_errors::Level::Warning && !sess.dcx().can_emit_warnings();
+
+        if !skip {
+            decorate(&mut err);
         }
 
         explain_lint_level_source(lint, level, src, &mut err);

From c1cf422140c511d351eb8f943073c03dcbe6bc5f Mon Sep 17 00:00:00 2001
From: Ayush Singh <ayushdevel1325@gmail.com>
Date: Sun, 4 Feb 2024 15:52:39 +0530
Subject: [PATCH 07/13] Mark UEFI std support as WIP

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
---
 src/doc/rustc/src/platform-support.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md
index 2ebbf5e15e6..96300497bd1 100644
--- a/src/doc/rustc/src/platform-support.md
+++ b/src/doc/rustc/src/platform-support.md
@@ -118,6 +118,7 @@ The `std` column in the table below has the following meanings:
 
 * ✓ indicates the full standard library is available.
 * \* indicates the target only supports [`no_std`] development.
+* ? indicates the standard library support is unknown or a work-in-progress.
 
 [`no_std`]: https://rust-embedded.github.io/book/intro/no-std.html
 
@@ -140,7 +141,7 @@ target | std | notes
 [`aarch64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | ARM64 OpenHarmony
 `aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
 `aarch64-unknown-none` | * | Bare ARM64, hardfloat
-[`aarch64-unknown-uefi`](platform-support/unknown-uefi.md) | * | ARM64 UEFI
+[`aarch64-unknown-uefi`](platform-support/unknown-uefi.md) | ? | ARM64 UEFI
 [`arm-linux-androideabi`](platform-support/android.md) | ✓ | ARMv6 Android
 `arm-unknown-linux-musleabi` | ✓ | ARMv6 Linux with musl 1.2.3
 `arm-unknown-linux-musleabihf` | ✓ | ARMv6 Linux with musl 1.2.3, hardfloat
@@ -162,7 +163,7 @@ target | std | notes
 [`i686-linux-android`](platform-support/android.md) | ✓ | 32-bit x86 Android [^x86_32-floats-return-ABI]
 `i686-unknown-freebsd` | ✓ | 32-bit FreeBSD [^x86_32-floats-return-ABI]
 `i686-unknown-linux-musl` | ✓ | 32-bit Linux with musl 1.2.3 [^x86_32-floats-return-ABI]
-[`i686-unknown-uefi`](platform-support/unknown-uefi.md) | * | 32-bit UEFI
+[`i686-unknown-uefi`](platform-support/unknown-uefi.md) | ? | 32-bit UEFI
 [`loongarch64-unknown-none`](platform-support/loongarch-none.md) | * |  | LoongArch64 Bare-metal (LP64D ABI)
 [`loongarch64-unknown-none-softfloat`](platform-support/loongarch-none.md) | * |  | LoongArch64 Bare-metal (LP64S ABI)
 [`nvptx64-nvidia-cuda`](platform-support/nvptx64-nvidia-cuda.md) | * | --emit=asm generates PTX code that [runs on NVIDIA GPUs]
@@ -199,7 +200,7 @@ target | std | notes
 [`x86_64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | x86_64 OpenHarmony
 [`x86_64-unknown-none`](platform-support/x86_64-unknown-none.md) | * | Freestanding/bare-metal x86_64, softfloat
 `x86_64-unknown-redox` | ✓ | Redox OS
-[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | * | 64-bit UEFI
+[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | ? | 64-bit UEFI
 
 [^x86_32-floats-x87]: Floating-point support on `i586` targets is non-compliant: the `x87` registers and instructions used for these targets do not provide IEEE-754-compliant behavior, in particular when it comes to rounding and NaN payload bits. See [issue #114479][x86-32-float-issue].
 [wasi-rename]: https://github.com/rust-lang/compiler-team/issues/607

From 01864e282a0d0e7f33d26220f23bde501186eb14 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Fri, 1 Mar 2024 09:24:33 -0800
Subject: [PATCH 08/13] Add release notes for 1.77.0

---
 RELEASES.md | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 124 insertions(+)

diff --git a/RELEASES.md b/RELEASES.md
index 20e317a4d23..e173a39bf96 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,3 +1,127 @@
+Version 1.77.0 (2024-03-21)
+==========================
+
+<a id="1.77.0-Language"></a>
+
+Language
+--------
+
+- [Reveal opaque types within the defining body for exhaustiveness checking.](https://github.com/rust-lang/rust/pull/116821/)
+- [Stabilize C-string literals.](https://github.com/rust-lang/rust/pull/117472/)
+- [Stabilize THIR unsafeck.](https://github.com/rust-lang/rust/pull/117673/)
+- [Support async recursive calls (as long as they have indirection).](https://github.com/rust-lang/rust/pull/117703/)
+- [Get rid of type-driven traversal in const-eval interning.](https://github.com/rust-lang/rust/pull/119044/)
+- [Deny braced macro invocations in let-else.](https://github.com/rust-lang/rust/pull/119062/)
+
+<!-- TODO: remaining T-types changes => lang or compiler? -->
+- [error on incorrect implied bounds in wfcheck except for Bevy dependents](https://github.com/rust-lang/rust/pull/118553/)
+- [Make inductive cycles in coherence ambiguous always](https://github.com/rust-lang/rust/pull/118649/)
+- [fix fn/const items implied bounds and wf check (rebase)](https://github.com/rust-lang/rust/pull/120019/)
+
+<a id="1.77.0-Compiler"></a>
+
+Compiler
+--------
+
+- [Include lint `soft_unstable` in future breakage reports.](https://github.com/rust-lang/rust/pull/116274/)
+- [Make `i128` and `u128` 16-byte aligned on x86-based targets.](https://github.com/rust-lang/rust/pull/116672/)
+- [Add lint `static_mut_ref` to warn on references to mutable statics.](https://github.com/rust-lang/rust/pull/117556/)
+- [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/)
+- [Use `--verbose` in diagnostic output.](https://github.com/rust-lang/rust/pull/119129/)
+- [Improve spacing between printed tokens.](https://github.com/rust-lang/rust/pull/120227/)
+- [Merge the `unused_tuple_struct_fields` lint into `dead_code`.](https://github.com/rust-lang/rust/pull/118297/)
+- [Fix coverage instrumentation/reports for non-ASCII source code.](https://github.com/rust-lang/rust/pull/119033/)
+- [Promote `riscv32{im|imafc}-unknown-none-elf` targets to tier 2.](https://github.com/rust-lang/rust/pull/118704/)
+- Add several new tier 3 targets:
+  - [`aarch64-unknown-illumos`](https://github.com/rust-lang/rust/pull/112936/)
+  - [`hexagon-unknown-none-elf`](https://github.com/rust-lang/rust/pull/117601/)
+  - [`riscv32imafc-esp-espidf`](https://github.com/rust-lang/rust/pull/119738/)
+  - [`riscv32im-risc0-zkvm-elf`](https://github.com/rust-lang/rust/pull/117958/)
+
+Refer to Rust's [platform support page][platform-support-doc]
+for more information on Rust's tiered platform support.
+
+<a id="1.77.0-Libraries"></a>
+
+Libraries
+---------
+
+- [Implement `From<&[T; N]>` for `Cow<[T]>`.](https://github.com/rust-lang/rust/pull/113489/)
+- [Remove special-case handling of `vec.split_off(0)`.](https://github.com/rust-lang/rust/pull/119917/)
+
+<a id="1.77.0-Stabilized-APIs"></a>
+
+Stabilized APIs
+---------------
+
+- [`array::each_ref`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_ref)
+- [`array::each_mut`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut)
+- [`core::net`](https://doc.rust-lang.org/stable/core/net/index.html)
+- [`f32::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round_ties_even)
+- [`f64::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round_ties_even)
+- [`mem::offset_of!`](https://doc.rust-lang.org/stable/std/mem/macro.offset_of.html)
+- [`slice::first_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk)
+- [`slice::first_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk_mut)
+- [`slice::split_first_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk)
+- [`slice::split_first_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk_mut)
+- [`slice::last_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk)
+- [`slice::last_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk_mut)
+- [`slice::split_last_chunk`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk)
+- [`slice::split_last_chunk_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk_mut)
+- [`slice::chunk_by`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by)
+- [`slice::chunk_by_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by_mut)
+- [`Bound::map`](https://doc.rust-lang.org/stable/std/ops/enum.Bound.html#method.map)
+- [`File::create_new`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.create_new)
+- [`Mutex::clear_poison`](https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#method.clear_poison)
+- [`RwLock::clear_poison`](https://doc.rust-lang.org/stable/std/sync/struct.RwLock.html#method.clear_poison)
+
+<a id="1.77.0-Cargo"></a>
+
+Cargo
+-----
+
+- [Extend the build directive syntax with `cargo::`.](https://github.com/rust-lang/cargo/pull/12201/)
+- [Stabilize metadata `id` format as `PackageIDSpec`.](https://github.com/rust-lang/cargo/pull/12914/)
+- [Pull out as `cargo-util-schemas` as a crate.](https://github.com/rust-lang/cargo/pull/13178/)
+- [Strip all debuginfo when debuginfo is not requested.](https://github.com/rust-lang/cargo/pull/13257/)
+- [Inherit jobserver from env for all kinds of runners.](https://github.com/rust-lang/cargo/pull/12776/)
+- [Deprecate rustc plugin support in cargo.](https://github.com/rust-lang/cargo/pull/13248/)
+
+<a id="1.77.0-Rustdoc"></a>
+
+Rustdoc
+-----
+
+- [Allows links in markdown headings.](https://github.com/rust-lang/rust/pull/117662/)
+- [Search for tuples and unit by type with `()`.](https://github.com/rust-lang/rust/pull/118194/)
+- [Clean up the source sidebar's hide button.](https://github.com/rust-lang/rust/pull/119066/)
+- [Prevent JS injection from `localStorage`.](https://github.com/rust-lang/rust/pull/120250/)
+
+<a id="1.77.0-Misc"></a>
+
+Misc
+----
+
+- [Use version-sorting for all sorting.](https://github.com/rust-lang/rust/pull/115046/)
+
+<a id="1.77.0-Compatibility-Notes"></a>
+
+Compatibility Notes
+-------------------
+
+<!-- TODO -->
+
+<a id="1.77.0-Internal-Changes"></a>
+
+Internal Changes
+----------------
+
+These changes do not affect any public interfaces of Rust, but they represent
+significant improvements to the performance or internals of rustc and related
+tools.
+
+- [Add more weirdness to `weird-exprs.rs`.](https://github.com/rust-lang/rust/pull/119028/)
+
 Version 1.76.0 (2024-02-08)
 ==========================
 

From 0ac3d4df6d5b660e42ab829968f74bdfa7e3662b Mon Sep 17 00:00:00 2001
From: Josh Stone <cuviper@gmail.com>
Date: Sun, 17 Mar 2024 09:35:48 -0700
Subject: [PATCH 09/13] Apply suggestions from code review

Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
Co-authored-by: Michael Howell <michael@notriddle.com>
---
 RELEASES.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/RELEASES.md b/RELEASES.md
index e173a39bf96..57fe92fd80b 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -25,7 +25,7 @@ Compiler
 
 - [Include lint `soft_unstable` in future breakage reports.](https://github.com/rust-lang/rust/pull/116274/)
 - [Make `i128` and `u128` 16-byte aligned on x86-based targets.](https://github.com/rust-lang/rust/pull/116672/)
-- [Add lint `static_mut_ref` to warn on references to mutable statics.](https://github.com/rust-lang/rust/pull/117556/)
+- [Add lint `static_mut_refs` to warn on references to mutable statics.](https://github.com/rust-lang/rust/pull/117556/)
 - [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/)
 - [Use `--verbose` in diagnostic output.](https://github.com/rust-lang/rust/pull/119129/)
 - [Improve spacing between printed tokens.](https://github.com/rust-lang/rust/pull/120227/)
@@ -102,7 +102,7 @@ Rustdoc
 Misc
 ----
 
-- [Use version-sorting for all sorting.](https://github.com/rust-lang/rust/pull/115046/)
+- [Recommend version-sorting for all sorting in style guide.](https://github.com/rust-lang/rust/pull/115046/)
 
 <a id="1.77.0-Compatibility-Notes"></a>
 

From 213e598fae81fee52327821bce83e544229f4006 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Sun, 17 Mar 2024 09:39:13 -0700
Subject: [PATCH 10/13] Move a couple issues to Language notes

---
 RELEASES.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/RELEASES.md b/RELEASES.md
index 57fe92fd80b..7ff3f4bf264 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -9,7 +9,9 @@ Language
 - [Reveal opaque types within the defining body for exhaustiveness checking.](https://github.com/rust-lang/rust/pull/116821/)
 - [Stabilize C-string literals.](https://github.com/rust-lang/rust/pull/117472/)
 - [Stabilize THIR unsafeck.](https://github.com/rust-lang/rust/pull/117673/)
+- [Add lint `static_mut_refs` to warn on references to mutable statics.](https://github.com/rust-lang/rust/pull/117556/)
 - [Support async recursive calls (as long as they have indirection).](https://github.com/rust-lang/rust/pull/117703/)
+- [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/)
 - [Get rid of type-driven traversal in const-eval interning.](https://github.com/rust-lang/rust/pull/119044/)
 - [Deny braced macro invocations in let-else.](https://github.com/rust-lang/rust/pull/119062/)
 
@@ -25,8 +27,6 @@ Compiler
 
 - [Include lint `soft_unstable` in future breakage reports.](https://github.com/rust-lang/rust/pull/116274/)
 - [Make `i128` and `u128` 16-byte aligned on x86-based targets.](https://github.com/rust-lang/rust/pull/116672/)
-- [Add lint `static_mut_refs` to warn on references to mutable statics.](https://github.com/rust-lang/rust/pull/117556/)
-- [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/)
 - [Use `--verbose` in diagnostic output.](https://github.com/rust-lang/rust/pull/119129/)
 - [Improve spacing between printed tokens.](https://github.com/rust-lang/rust/pull/120227/)
 - [Merge the `unused_tuple_struct_fields` lint into `dead_code`.](https://github.com/rust-lang/rust/pull/118297/)

From 4a2f0f6c995827a64ab690a0074f4d61e13251a2 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Sun, 17 Mar 2024 09:42:42 -0700
Subject: [PATCH 11/13] The const-eval change is now future-compat

---
 RELEASES.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/RELEASES.md b/RELEASES.md
index 7ff3f4bf264..48058a1171a 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -12,7 +12,8 @@ Language
 - [Add lint `static_mut_refs` to warn on references to mutable statics.](https://github.com/rust-lang/rust/pull/117556/)
 - [Support async recursive calls (as long as they have indirection).](https://github.com/rust-lang/rust/pull/117703/)
 - [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/)
-- [Get rid of type-driven traversal in const-eval interning.](https://github.com/rust-lang/rust/pull/119044/)
+- [Get rid of type-driven traversal in const-eval interning](https://github.com/rust-lang/rust/pull/119044/),
+  only as a [future compatiblity lint](https://github.com/rust-lang/rust/pull/122204) for now.
 - [Deny braced macro invocations in let-else.](https://github.com/rust-lang/rust/pull/119062/)
 
 <!-- TODO: remaining T-types changes => lang or compiler? -->

From 8953306016e5d42cd2882b94adf01cfd33d865b4 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Sun, 17 Mar 2024 09:46:23 -0700
Subject: [PATCH 12/13] No compatibility notes raised in 1.77.0

---
 RELEASES.md | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/RELEASES.md b/RELEASES.md
index 48058a1171a..870346018b9 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -105,13 +105,6 @@ Misc
 
 - [Recommend version-sorting for all sorting in style guide.](https://github.com/rust-lang/rust/pull/115046/)
 
-<a id="1.77.0-Compatibility-Notes"></a>
-
-Compatibility Notes
--------------------
-
-<!-- TODO -->
-
 <a id="1.77.0-Internal-Changes"></a>
 
 Internal Changes

From 87c9349e1b0306279736c7d34bd967086b12296b Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Sun, 17 Mar 2024 09:58:02 -0700
Subject: [PATCH 13/13] Sort the remaining T-types relnotes

---
 RELEASES.md | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/RELEASES.md b/RELEASES.md
index 870346018b9..3f7814d184c 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -12,15 +12,11 @@ Language
 - [Add lint `static_mut_refs` to warn on references to mutable statics.](https://github.com/rust-lang/rust/pull/117556/)
 - [Support async recursive calls (as long as they have indirection).](https://github.com/rust-lang/rust/pull/117703/)
 - [Undeprecate lint `unstable_features` and make use of it in the compiler.](https://github.com/rust-lang/rust/pull/118639/)
+- [Make inductive cycles in coherence ambiguous always.](https://github.com/rust-lang/rust/pull/118649/)
 - [Get rid of type-driven traversal in const-eval interning](https://github.com/rust-lang/rust/pull/119044/),
   only as a [future compatiblity lint](https://github.com/rust-lang/rust/pull/122204) for now.
 - [Deny braced macro invocations in let-else.](https://github.com/rust-lang/rust/pull/119062/)
 
-<!-- TODO: remaining T-types changes => lang or compiler? -->
-- [error on incorrect implied bounds in wfcheck except for Bevy dependents](https://github.com/rust-lang/rust/pull/118553/)
-- [Make inductive cycles in coherence ambiguous always](https://github.com/rust-lang/rust/pull/118649/)
-- [fix fn/const items implied bounds and wf check (rebase)](https://github.com/rust-lang/rust/pull/120019/)
-
 <a id="1.77.0-Compiler"></a>
 
 Compiler
@@ -31,7 +27,10 @@ Compiler
 - [Use `--verbose` in diagnostic output.](https://github.com/rust-lang/rust/pull/119129/)
 - [Improve spacing between printed tokens.](https://github.com/rust-lang/rust/pull/120227/)
 - [Merge the `unused_tuple_struct_fields` lint into `dead_code`.](https://github.com/rust-lang/rust/pull/118297/)
+- [Error on incorrect implied bounds in well-formedness check](https://github.com/rust-lang/rust/pull/118553/),
+  with a temporary exception for Bevy.
 - [Fix coverage instrumentation/reports for non-ASCII source code.](https://github.com/rust-lang/rust/pull/119033/)
+- [Fix `fn`/`const` items implied bounds and well-formedness check.](https://github.com/rust-lang/rust/pull/120019/)
 - [Promote `riscv32{im|imafc}-unknown-none-elf` targets to tier 2.](https://github.com/rust-lang/rust/pull/118704/)
 - Add several new tier 3 targets:
   - [`aarch64-unknown-illumos`](https://github.com/rust-lang/rust/pull/112936/)