about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-27 07:01:20 +0000
committerbors <bors@rust-lang.org>2024-09-27 07:01:20 +0000
commitb9dc4a30e116c6bd1b873fa79379ea70e102c47b (patch)
tree008a966bf310c21f71a5bdb39cbb1bd9a614e74b
parent58420a065b68ecb3eec03b942740c761cdadd5c4 (diff)
parentb463bd1f27a4a9175374d685dc4186598fe4aff8 (diff)
Auto merge of #130919 - workingjubilee:rollup-4diycoy, r=workingjubilee
Rollup of 8 pull requests

Successful merges:

 - #130313 ([`cfg_match`] Generalize inputs)
 - #130706 ([rustdoc] Remove unneeded jinja comments)
 - #130846 (Revert Break into the debugger on panic (129019))
 - #130875 (update `compiler-builtins` to 0.1.126)
 - #130889 (Weekly `cargo update`: only `rustbook`)
 - #130892 (Partially update `library/Cargo.lock`)
 - #130911 (diagnostics: wrap fn cast suggestions in parens when needed)
 - #130912 (On implicit `Sized` bound on fn argument, point at type instead of pattern)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_hir_typeck/src/check.rs2
-rw-r--r--compiler/rustc_hir_typeck/src/gather_locals.rs2
-rw-r--r--compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs29
-rw-r--r--library/Cargo.lock68
-rw-r--r--library/alloc/Cargo.toml2
-rw-r--r--library/core/src/arch.rs34
-rw-r--r--library/core/src/macros/mod.rs10
-rw-r--r--library/core/tests/macros.rs20
-rw-r--r--library/std/Cargo.toml2
-rw-r--r--library/std/src/panicking.rs18
-rw-r--r--library/std/src/sys/dbg.rs152
-rw-r--r--library/std/src/sys/mod.rs1
-rw-r--r--src/librustdoc/html/templates/item_info.html2
-rw-r--r--src/librustdoc/html/templates/page.html62
-rw-r--r--src/librustdoc/html/templates/print_item.html2
-rw-r--r--src/librustdoc/html/templates/short_item_info.html10
-rw-r--r--src/librustdoc/html/templates/sidebar.html2
-rw-r--r--src/librustdoc/html/templates/source.html2
-rw-r--r--src/librustdoc/html/templates/type_layout.html20
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-6251.stderr4
-rw-r--r--src/tools/rustbook/Cargo.lock448
-rw-r--r--src/tools/tidy/src/issues.txt1
-rw-r--r--src/tools/tidy/src/rustdoc_templates.rs34
-rw-r--r--tests/ui/associated-types/issue-59324.stderr4
-rw-r--r--tests/ui/coherence/occurs-check/opaques.next.stderr4
-rw-r--r--tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr4
-rw-r--r--tests/ui/error-codes/E0277.stderr4
-rw-r--r--tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr12
-rw-r--r--tests/ui/feature-gates/feature-gate-unsized_locals.stderr4
-rw-r--r--tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr4
-rw-r--r--tests/ui/issues/issue-38954.stderr4
-rw-r--r--tests/ui/issues/issue-41229-ref-str.stderr4
-rw-r--r--tests/ui/issues/issue-42312.stderr8
-rw-r--r--tests/ui/issues/issue-5883.stderr4
-rw-r--r--tests/ui/issues/issue-66706.stderr4
-rw-r--r--tests/ui/object-safety/avoid-ice-on-warning-2.new.stderr4
-rw-r--r--tests/ui/object-safety/avoid-ice-on-warning-2.old.stderr4
-rw-r--r--tests/ui/resolve/issue-3907-2.stderr4
-rw-r--r--tests/ui/resolve/issue-5035-2.stderr4
-rw-r--r--tests/ui/suggestions/object-unsafe-trait-references-self.stderr4
-rw-r--r--tests/ui/suggestions/path-by-value.stderr4
-rw-r--r--tests/ui/suggestions/unsized-function-parameter.stderr12
-rw-r--r--tests/ui/trait-bounds/apit-unsized.stderr18
-rw-r--r--tests/ui/trait-bounds/bad-suggestionf-for-repeated-unsized-bound-127441.stderr52
-rw-r--r--tests/ui/traits/alias/dont-elaborate-non-self.stderr4
-rw-r--r--tests/ui/traits/bound/not-on-bare-trait-2021.stderr8
-rw-r--r--tests/ui/traits/bound/not-on-bare-trait.stderr8
-rw-r--r--tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs (renamed from tests/ui/traits/issue-99875.rs)0
-rw-r--r--tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr (renamed from tests/ui/traits/issue-99875.stderr)12
-rw-r--r--tests/ui/traits/fn-pointer/fn-trait-cast-diagnostic.rs (renamed from tests/ui/traits/fn-trait-cast-diagnostic.rs)0
-rw-r--r--tests/ui/traits/fn-pointer/fn-trait-cast-diagnostic.stderr (renamed from tests/ui/traits/fn-trait-cast-diagnostic.stderr)0
-rw-r--r--tests/ui/traits/fn-pointer/suggest-wrap-parens-method.fixed15
-rw-r--r--tests/ui/traits/fn-pointer/suggest-wrap-parens-method.rs15
-rw-r--r--tests/ui/traits/fn-pointer/suggest-wrap-parens-method.stderr19
-rw-r--r--tests/ui/traits/fn-pointer/suggest-wrap-parens.fixed10
-rw-r--r--tests/ui/traits/fn-pointer/suggest-wrap-parens.rs10
-rw-r--r--tests/ui/traits/fn-pointer/suggest-wrap-parens.stderr15
-rw-r--r--tests/ui/type/type-check/unknown_type_for_closure.stderr4
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item.stderr4
-rw-r--r--tests/ui/unsized/unsized-fn-arg.stderr4
-rw-r--r--tests/ui/unsized/unsized6.stderr8
61 files changed, 626 insertions, 603 deletions
diff --git a/compiler/rustc_hir_typeck/src/check.rs b/compiler/rustc_hir_typeck/src/check.rs
index f2d3a3b509a..2d8943c6159 100644
--- a/compiler/rustc_hir_typeck/src/check.rs
+++ b/compiler/rustc_hir_typeck/src/check.rs
@@ -99,7 +99,7 @@ pub(super) fn check_fn<'a, 'tcx>(
         if !params_can_be_unsized {
             fcx.require_type_is_sized(
                 param_ty,
-                param.pat.span,
+                param.ty_span,
                 // ty.span == binding_span iff this is a closure parameter with no type ascription,
                 // or if it's an implicit `self` parameter
                 ObligationCauseCode::SizedArgumentType(
diff --git a/compiler/rustc_hir_typeck/src/gather_locals.rs b/compiler/rustc_hir_typeck/src/gather_locals.rs
index 83c9a4878d2..5ae8d2230f8 100644
--- a/compiler/rustc_hir_typeck/src/gather_locals.rs
+++ b/compiler/rustc_hir_typeck/src/gather_locals.rs
@@ -144,7 +144,7 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
                 if !self.fcx.tcx.features().unsized_fn_params {
                     self.fcx.require_type_is_sized(
                         var_ty,
-                        p.span,
+                        ty_span,
                         // ty_span == ident.span iff this is a closure parameter with no type
                         // ascription, or if it's an implicit `self` parameter
                         ObligationCauseCode::SizedArgumentType(
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
index 969f2528836..9cd2b1e7bfb 100644
--- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
+++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
@@ -33,7 +33,8 @@ use tracing::{debug, instrument};
 use super::on_unimplemented::{AppendConstMessage, OnUnimplementedNote};
 use super::suggestions::get_explanation_based_on_obligation;
 use super::{
-    ArgKind, CandidateSimilarity, GetSafeTransmuteErrorAndReason, ImplCandidate, UnsatisfiedConst,
+    ArgKind, CandidateSimilarity, FindExprBySpan, GetSafeTransmuteErrorAndReason, ImplCandidate,
+    UnsatisfiedConst,
 };
 use crate::error_reporting::TypeErrCtxt;
 use crate::error_reporting::infer::TyCategory;
@@ -378,14 +379,34 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
                             if let (ty::FnPtr(..), ty::FnDef(..)) =
                                 (cand.self_ty().kind(), main_trait_ref.self_ty().skip_binder().kind())
                             {
-                                err.span_suggestion(
-                                    span.shrink_to_hi(),
+                                // Wrap method receivers and `&`-references in parens
+                                let suggestion = if self.tcx.sess.source_map().span_look_ahead(span, ".", Some(50)).is_some() {
+                                    vec![
+                                        (span.shrink_to_lo(), format!("(")),
+                                        (span.shrink_to_hi(), format!(" as {})", cand.self_ty())),
+                                    ]
+                                } else if let Some(body) = self.tcx.hir().maybe_body_owned_by(obligation.cause.body_id) {
+                                    let mut expr_finder = FindExprBySpan::new(span, self.tcx);
+                                    expr_finder.visit_expr(body.value);
+                                    if let Some(expr) = expr_finder.result &&
+                                        let hir::ExprKind::AddrOf(_, _, expr) = expr.kind {
+                                        vec![
+                                            (expr.span.shrink_to_lo(), format!("(")),
+                                            (expr.span.shrink_to_hi(), format!(" as {})", cand.self_ty())),
+                                        ]
+                                    } else {
+                                        vec![(span.shrink_to_hi(), format!(" as {}", cand.self_ty()))]
+                                    }
+                                } else {
+                                    vec![(span.shrink_to_hi(), format!(" as {}", cand.self_ty()))]
+                                };
+                                err.multipart_suggestion(
                                     format!(
                                         "the trait `{}` is implemented for fn pointer `{}`, try casting using `as`",
                                         cand.print_trait_sugared(),
                                         cand.self_ty(),
                                     ),
-                                    format!(" as {}", cand.self_ty()),
+                                    suggestion,
                                     Applicability::MaybeIncorrect,
                                 );
                                 true
diff --git a/library/Cargo.lock b/library/Cargo.lock
index 2343b2baf83..3f33c9d4b0a 100644
--- a/library/Cargo.lock
+++ b/library/Cargo.lock
@@ -58,9 +58,9 @@ dependencies = [
 
 [[package]]
 name = "compiler_builtins"
-version = "0.1.125"
+version = "0.1.126"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd02a01d7bc069bed818e956600fe437ee222dd1d6ad92bfb9db87b43b71fd87"
+checksum = "758019257ad46e191b587d8f711022a6ac1d1fb6745d75e1d76c587fdcbca770"
 dependencies = [
  "cc",
  "rustc-std-workspace-core",
@@ -110,9 +110,9 @@ dependencies = [
 
 [[package]]
 name = "gimli"
-version = "0.28.1"
+version = "0.29.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
+checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
 dependencies = [
  "compiler_builtins",
  "rustc-std-workspace-alloc",
@@ -121,9 +121,9 @@ dependencies = [
 
 [[package]]
 name = "gimli"
-version = "0.29.0"
+version = "0.30.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
+checksum = "e2e1d97fbe9722ba9bbd0c97051c2956e726562b61f86a25a4360398a40edfc9"
 dependencies = [
  "compiler_builtins",
  "rustc-std-workspace-alloc",
@@ -155,9 +155,9 @@ dependencies = [
 
 [[package]]
 name = "libc"
-version = "0.2.158"
+version = "0.2.159"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
+checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
 dependencies = [
  "rustc-std-workspace-core",
 ]
@@ -186,9 +186,9 @@ dependencies = [
 
 [[package]]
 name = "object"
-version = "0.36.2"
+version = "0.36.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
+checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a"
 dependencies = [
  "compiler_builtins",
  "memchr",
@@ -375,9 +375,9 @@ dependencies = [
 
 [[package]]
 name = "unicode-width"
-version = "0.1.13"
+version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
+checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
 dependencies = [
  "compiler_builtins",
  "rustc-std-workspace-core",
@@ -397,12 +397,12 @@ dependencies = [
 
 [[package]]
 name = "unwinding"
-version = "0.2.1"
+version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37a19a21a537f635c16c7576f22d0f2f7d63353c1337ad4ce0d8001c7952a25b"
+checksum = "dc55842d0db6329a669d55a623c674b02d677b16bfb2d24857d4089d41eba882"
 dependencies = [
  "compiler_builtins",
- "gimli 0.28.1",
+ "gimli 0.30.0",
  "rustc-std-workspace-core",
 ]
 
@@ -423,7 +423,7 @@ version = "0.52.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
 dependencies = [
- "windows-targets 0.52.5",
+ "windows-targets 0.52.6",
 ]
 
 [[package]]
@@ -432,9 +432,9 @@ version = "0.0.0"
 
 [[package]]
 name = "windows-targets"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
 dependencies = [
  "windows_aarch64_gnullvm",
  "windows_aarch64_msvc",
@@ -448,48 +448,48 @@ dependencies = [
 
 [[package]]
 name = "windows_aarch64_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
 
 [[package]]
 name = "windows_aarch64_msvc"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
 
 [[package]]
 name = "windows_i686_gnu"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
 
 [[package]]
 name = "windows_i686_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
 
 [[package]]
 name = "windows_i686_msvc"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
 
 [[package]]
 name = "windows_x86_64_gnu"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
 
 [[package]]
 name = "windows_x86_64_gnullvm"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
 
 [[package]]
 name = "windows_x86_64_msvc"
-version = "0.52.5"
+version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
index 1da947d196f..1b76b4c4a50 100644
--- a/library/alloc/Cargo.toml
+++ b/library/alloc/Cargo.toml
@@ -10,7 +10,7 @@ edition = "2021"
 
 [dependencies]
 core = { path = "../core" }
-compiler_builtins = { version = "0.1.125", features = ['rustc-dep-of-std'] }
+compiler_builtins = { version = "0.1.126", features = ['rustc-dep-of-std'] }
 
 [dev-dependencies]
 rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
diff --git a/library/core/src/arch.rs b/library/core/src/arch.rs
index be734d194be..4945c045bc6 100644
--- a/library/core/src/arch.rs
+++ b/library/core/src/arch.rs
@@ -3,6 +3,9 @@
 #[allow(unused_imports)]
 #[stable(feature = "simd_arch", since = "1.27.0")]
 pub use crate::core_arch::arch::*;
+#[unstable(feature = "naked_functions", issue = "90957")]
+#[cfg(bootstrap)]
+pub use crate::naked_asm;
 
 /// Inline assembly.
 ///
@@ -25,6 +28,37 @@ pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
 /// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
 /// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
 #[unstable(feature = "naked_functions", issue = "90957")]
+#[macro_export]
+#[cfg(bootstrap)]
+macro_rules! naked_asm {
+    ([$last:expr], [$($pushed:expr),*]) => {
+        #[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
+        {
+            core::arch::asm!($($pushed),*, options(att_syntax, noreturn))
+        }
+        #[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
+        {
+            core::arch::asm!($($pushed),* , $last, options(noreturn))
+        }
+    };
+
+    ([$first:expr $(, $rest:expr)*], [$($pushed:expr),*]) => {
+        naked_asm!([$($rest),*], [$($pushed,)* $first]);
+    };
+
+    ($($expr:expr),* $(,)?) => {
+        naked_asm!([$($expr),*], []);
+    };
+}
+
+/// Inline assembly used in combination with `#[naked]` functions.
+///
+/// Refer to [Rust By Example] for a usage guide and the [reference] for
+/// detailed information about the syntax and available options.
+///
+/// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
+/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
+#[unstable(feature = "naked_functions", issue = "90957")]
 #[rustc_builtin_macro]
 #[cfg(not(bootstrap))]
 pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?) {
diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs
index 888832251f6..aa0646846e4 100644
--- a/library/core/src/macros/mod.rs
+++ b/library/core/src/macros/mod.rs
@@ -229,8 +229,8 @@ pub macro assert_matches {
 pub macro cfg_match {
     // with a final wildcard
     (
-        $(cfg($initial_meta:meta) => { $($initial_tokens:item)* })+
-        _ => { $($extra_tokens:item)* }
+        $(cfg($initial_meta:meta) => { $($initial_tokens:tt)* })+
+        _ => { $($extra_tokens:tt)* }
     ) => {
         cfg_match! {
             @__items ();
@@ -241,7 +241,7 @@ pub macro cfg_match {
 
     // without a final wildcard
     (
-        $(cfg($extra_meta:meta) => { $($extra_tokens:item)* })*
+        $(cfg($extra_meta:meta) => { $($extra_tokens:tt)* })*
     ) => {
         cfg_match! {
             @__items ();
@@ -256,7 +256,7 @@ pub macro cfg_match {
     (@__items ($($_:meta,)*);) => {},
     (
         @__items ($($no:meta,)*);
-        (($($yes:meta)?) ($($tokens:item)*)),
+        (($($yes:meta)?) ($($tokens:tt)*)),
         $($rest:tt,)*
     ) => {
         // Emit all items within one block, applying an appropriate #[cfg]. The
@@ -279,7 +279,7 @@ pub macro cfg_match {
 
     // Internal macro to make __apply work out right for different match types,
     // because of how macros match/expand stuff.
-    (@__identity $($tokens:item)*) => {
+    (@__identity $($tokens:tt)*) => {
         $($tokens)*
     }
 }
diff --git a/library/core/tests/macros.rs b/library/core/tests/macros.rs
index 09994fbcbdb..fdb4ea29412 100644
--- a/library/core/tests/macros.rs
+++ b/library/core/tests/macros.rs
@@ -1,3 +1,5 @@
+#![allow(unused_must_use)]
+
 #[allow(dead_code)]
 trait Trait {
     fn blah(&self);
@@ -173,3 +175,21 @@ fn cfg_match_two_functions() {
         bar2();
     }
 }
+
+fn _accepts_expressions() -> i32 {
+    cfg_match! {
+        cfg(unix) => { 1 }
+        _ => { 2 }
+    }
+}
+
+// The current implementation expands to a macro call, which allows the use of expression
+// statements.
+fn _allows_stmt_expr_attributes() {
+    let one = 1;
+    let two = 2;
+    cfg_match! {
+        cfg(unix) => { one * two; }
+        _ => { one + two; }
+    }
+}
diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml
index ea11586f9a5..d55114227af 100644
--- a/library/std/Cargo.toml
+++ b/library/std/Cargo.toml
@@ -17,7 +17,7 @@ cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
 panic_unwind = { path = "../panic_unwind", optional = true }
 panic_abort = { path = "../panic_abort" }
 core = { path = "../core", public = true }
-compiler_builtins = { version = "0.1.125" }
+compiler_builtins = { version = "0.1.126" }
 profiler_builtins = { path = "../profiler_builtins", optional = true }
 unwind = { path = "../unwind" }
 hashbrown = { version = "0.14", default-features = false, features = [
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index 9fe05db8126..ac1f547c914 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -23,8 +23,8 @@ use crate::mem::{self, ManuallyDrop};
 use crate::panic::{BacktraceStyle, PanicHookInfo};
 use crate::sync::atomic::{AtomicBool, Ordering};
 use crate::sync::{PoisonError, RwLock};
+use crate::sys::backtrace;
 use crate::sys::stdio::panic_output;
-use crate::sys::{backtrace, dbg};
 use crate::{fmt, intrinsics, process, thread};
 
 // Binary interface to the panic runtime that the standard library depends on.
@@ -859,14 +859,6 @@ pub fn rust_panic_without_hook(payload: Box<dyn Any + Send>) -> ! {
 #[cfg_attr(not(test), rustc_std_internal_symbol)]
 #[cfg(not(feature = "panic_immediate_abort"))]
 fn rust_panic(msg: &mut dyn PanicPayload) -> ! {
-    // Break into the debugger if it is attached.
-    // The return value is not currently used.
-    //
-    // This function isn't used anywhere else, and
-    // using inside `#[panic_handler]` doesn't seem
-    // to count, so a warning is issued.
-    let _ = dbg::breakpoint_if_debugging();
-
     let code = unsafe { __rust_start_panic(msg) };
     rtabort!("failed to initiate panic, error {code}")
 }
@@ -874,14 +866,6 @@ fn rust_panic(msg: &mut dyn PanicPayload) -> ! {
 #[cfg_attr(not(test), rustc_std_internal_symbol)]
 #[cfg(feature = "panic_immediate_abort")]
 fn rust_panic(_: &mut dyn PanicPayload) -> ! {
-    // Break into the debugger if it is attached.
-    // The return value is not currently used.
-    //
-    // This function isn't used anywhere else, and
-    // using inside `#[panic_handler]` doesn't seem
-    // to count, so a warning is issued.
-    let _ = dbg::breakpoint_if_debugging();
-
     unsafe {
         crate::intrinsics::abort();
     }
diff --git a/library/std/src/sys/dbg.rs b/library/std/src/sys/dbg.rs
deleted file mode 100644
index 7266a739e78..00000000000
--- a/library/std/src/sys/dbg.rs
+++ /dev/null
@@ -1,152 +0,0 @@
-//! Debugging aids.
-
-/// Presence of a debugger. The debugger being concerned
-/// is expected to use the OS API to debug this process.
-#[derive(Copy, Clone, Debug)]
-#[allow(unused)]
-pub(crate) enum DebuggerPresence {
-    /// The debugger is attached to this process.
-    Detected,
-    /// The debugger is not attached to this process.
-    NotDetected,
-}
-
-#[cfg(target_os = "windows")]
-mod os {
-    use super::DebuggerPresence;
-
-    #[link(name = "kernel32")]
-    extern "system" {
-        fn IsDebuggerPresent() -> i32;
-    }
-
-    pub(super) fn is_debugger_present() -> Option<DebuggerPresence> {
-        // SAFETY: No state is shared between threads. The call reads
-        // a field from the Thread Environment Block using the OS API
-        // as required by the documentation.
-        if unsafe { IsDebuggerPresent() } != 0 {
-            Some(DebuggerPresence::Detected)
-        } else {
-            Some(DebuggerPresence::NotDetected)
-        }
-    }
-}
-
-#[cfg(any(target_vendor = "apple", target_os = "freebsd"))]
-mod os {
-    use libc::{CTL_KERN, KERN_PROC, KERN_PROC_PID, c_int, sysctl};
-
-    use super::DebuggerPresence;
-    use crate::io::{Cursor, Read, Seek, SeekFrom};
-    use crate::process;
-
-    const P_TRACED: i32 = 0x00000800;
-
-    // The assumption is that the kernel structures available to the
-    // user space may not shrink or repurpose the existing fields over
-    // time. The kernels normally adhere to that for the backward
-    // compatibility of the user space.
-
-    // The macOS 14.5 SDK comes with a header `MacOSX14.5.sdk/usr/include/sys/sysctl.h`
-    // that defines `struct kinfo_proc` be of `648` bytes on the 64-bit system. That has
-    // not changed since macOS 10.13 (released in 2017) at least, validated by building
-    // a C program in XCode while changing the build target. Apple provides this example
-    // for reference: https://developer.apple.com/library/archive/qa/qa1361/_index.html.
-    #[cfg(target_vendor = "apple")]
-    const KINFO_PROC_SIZE: usize = if cfg!(target_pointer_width = "64") { 648 } else { 492 };
-    #[cfg(target_vendor = "apple")]
-    const KINFO_PROC_FLAGS_OFFSET: u64 = if cfg!(target_pointer_width = "64") { 32 } else { 16 };
-
-    // Works for FreeBSD stable (13.3, 13.4) and current (14.0, 14.1).
-    // The size of the structure has stayed the same for a long time,
-    // at least since 2005:
-    // https://lists.freebsd.org/pipermail/freebsd-stable/2005-November/019899.html
-    #[cfg(target_os = "freebsd")]
-    const KINFO_PROC_SIZE: usize = if cfg!(target_pointer_width = "64") { 1088 } else { 768 };
-    #[cfg(target_os = "freebsd")]
-    const KINFO_PROC_FLAGS_OFFSET: u64 = if cfg!(target_pointer_width = "64") { 368 } else { 296 };
-
-    pub(super) fn is_debugger_present() -> Option<DebuggerPresence> {
-        debug_assert_ne!(KINFO_PROC_SIZE, 0);
-
-        let mut flags = [0u8; 4]; // `ki_flag` under FreeBSD and `p_flag` under macOS.
-        let mut mib = [CTL_KERN, KERN_PROC, KERN_PROC_PID, process::id() as c_int];
-        let mut info_size = KINFO_PROC_SIZE;
-        let mut kinfo_proc = [0u8; KINFO_PROC_SIZE];
-
-        // SAFETY: No state is shared with other threads. The sysctl call
-        // is safe according to the documentation.
-        if unsafe {
-            sysctl(
-                mib.as_mut_ptr(),
-                mib.len() as u32,
-                kinfo_proc.as_mut_ptr().cast(),
-                &mut info_size,
-                core::ptr::null_mut(),
-                0,
-            )
-        } != 0
-        {
-            return None;
-        }
-        debug_assert_eq!(info_size, KINFO_PROC_SIZE);
-
-        let mut reader = Cursor::new(kinfo_proc);
-        reader.seek(SeekFrom::Start(KINFO_PROC_FLAGS_OFFSET)).ok()?;
-        reader.read_exact(&mut flags).ok()?;
-        // Just in case, not limiting this to the little-endian systems.
-        let flags = i32::from_ne_bytes(flags);
-
-        if flags & P_TRACED != 0 {
-            Some(DebuggerPresence::Detected)
-        } else {
-            Some(DebuggerPresence::NotDetected)
-        }
-    }
-}
-
-#[cfg(not(any(target_os = "windows", target_vendor = "apple", target_os = "freebsd")))]
-mod os {
-    pub(super) fn is_debugger_present() -> Option<super::DebuggerPresence> {
-        None
-    }
-}
-
-/// Detect the debugger presence.
-///
-/// The code does not try to detect the debugger at all costs (e.g., when anti-debugger
-/// tricks are at play), it relies on the interfaces provided by the OS.
-///
-/// Return value:
-/// * `None`: it's not possible to conclude whether the debugger is attached to this
-///    process or not. When checking for the presence of the debugger, the detection logic
-///    encountered an issue, such as the OS API throwing an error or the feature not being
-///    implemented.
-/// * `Some(DebuggerPresence::Detected)`: yes, the debugger is attached
-///   to this process.
-/// * `Some(DebuggerPresence::NotDetected)`: no, the debugger is not
-///    attached to this process.
-pub(crate) fn is_debugger_present() -> Option<DebuggerPresence> {
-    if cfg!(miri) { None } else { os::is_debugger_present() }
-}
-
-/// Execute the breakpoint instruction if the debugger presence is detected.
-/// Useful for breaking into the debugger without the need to set a breakpoint
-/// in the debugger.
-///
-/// Note that there is a race between attaching or detaching the debugger, and running the
-/// breakpoint instruction. This is nonetheless memory-safe, like [`crate::process::abort`]
-/// is. In case the debugger is attached and the function is about
-/// to run the breakpoint instruction yet right before that the debugger detaches, the
-/// process will crash due to running the breakpoint instruction and the debugger not
-/// handling the trap exception.
-pub(crate) fn breakpoint_if_debugging() -> Option<DebuggerPresence> {
-    let debugger_present = is_debugger_present();
-    if let Some(DebuggerPresence::Detected) = debugger_present {
-        // SAFETY: Executing the breakpoint instruction. No state is shared
-        // or modified by this code.
-        unsafe { core::intrinsics::breakpoint() };
-    }
-
-    debugger_present
-}
diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs
index df25b84fbbe..f17dd47dece 100644
--- a/library/std/src/sys/mod.rs
+++ b/library/std/src/sys/mod.rs
@@ -11,7 +11,6 @@ mod personality;
 pub mod anonymous_pipe;
 pub mod backtrace;
 pub mod cmath;
-pub mod dbg;
 pub mod exit_guard;
 pub mod os_str;
 pub mod path;
diff --git a/src/librustdoc/html/templates/item_info.html b/src/librustdoc/html/templates/item_info.html
index 9e65ae95e15..9fee268622e 100644
--- a/src/librustdoc/html/templates/item_info.html
+++ b/src/librustdoc/html/templates/item_info.html
@@ -1,7 +1,7 @@
 {% if !items.is_empty() %}
     <span class="item-info">
         {% for item in items %}
-            {{item|safe}} {# #}
+            {{item|safe}}
         {% endfor %}
     </span>
 {% endif %}
diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html
index 65c4304e202..a05d6ca8313 100644
--- a/src/librustdoc/html/templates/page.html
+++ b/src/librustdoc/html/templates/page.html
@@ -12,13 +12,13 @@
     <link rel="stylesheet" {#+ #}
           href="{{static_root_path|safe}}{{files.normalize_css}}"> {# #}
     <link rel="stylesheet" {#+ #}
-          href="{{static_root_path|safe}}{{files.rustdoc_css}}"> {# #}
+          href="{{static_root_path|safe}}{{files.rustdoc_css}}">
     {% if !layout.default_settings.is_empty() %}
     <script id="default-settings" {#+ #}
       {%~ for (k, v) in layout.default_settings ~%}
         data-{{k}}="{{v}}"
       {% endfor %}
-    ></script> {# #}
+    ></script>
     {% endif %}
     <meta name="rustdoc-vars" {#+ #}
          data-root-path="{{page.root_path|safe}}" {#+ #}
@@ -31,36 +31,36 @@
          data-search-js="{{files.search_js}}" {#+ #}
          data-settings-js="{{files.settings_js}}" {#+ #}
     > {# #}
-    <script src="{{static_root_path|safe}}{{files.storage_js}}"></script> {# #}
+    <script src="{{static_root_path|safe}}{{files.storage_js}}"></script>
     {% if page.css_class.contains("crate") %}
-    <script defer src="{{page.root_path|safe}}crates{{page.resource_suffix}}.js"></script> {# #}
+    <script defer src="{{page.root_path|safe}}crates{{page.resource_suffix}}.js"></script>
     {% else if page.css_class == "src" %}
     <script defer src="{{static_root_path|safe}}{{files.src_script_js}}"></script> {# #}
-    <script defer src="{{page.root_path|safe}}src-files{{page.resource_suffix}}.js"></script> {# #}
+    <script defer src="{{page.root_path|safe}}src-files{{page.resource_suffix}}.js"></script>
     {% else if !page.css_class.contains("mod") %}
-    <script defer src="sidebar-items{{page.resource_suffix}}.js"></script> {# #}
+    <script defer src="sidebar-items{{page.resource_suffix}}.js"></script>
     {% else if !page.css_class.contains("sys") %}
-    <script defer src="../sidebar-items{{page.resource_suffix}}.js"></script> {# #}
+    <script defer src="../sidebar-items{{page.resource_suffix}}.js"></script>
     {% endif %}
-    <script defer src="{{static_root_path|safe}}{{files.main_js}}"></script> {# #}
+    <script defer src="{{static_root_path|safe}}{{files.main_js}}"></script>
     {% if layout.scrape_examples_extension %}
-    <script defer src="{{static_root_path|safe}}{{files.scrape_examples_js}}"></script> {# #}
+    <script defer src="{{static_root_path|safe}}{{files.scrape_examples_js}}"></script>
     {% endif %}
     <noscript> {# #}
         <link rel="stylesheet" {#+ #}
            href="{{static_root_path|safe}}{{files.noscript_css}}"> {# #}
-    </noscript> {# #}
+    </noscript>
     {% if layout.css_file_extension.is_some() %}
         <link rel="stylesheet" {#+ #}
-            href="{{page.root_path|safe}}theme{{page.resource_suffix}}.css"> {# #}
+            href="{{page.root_path|safe}}theme{{page.resource_suffix}}.css">
     {% endif %}
     {% if !layout.favicon.is_empty() %}
-        <link rel="icon" href="{{layout.favicon}}"> {# #}
+        <link rel="icon" href="{{layout.favicon}}">
     {% else %}
         <link rel="alternate icon" type="image/png" {#+ #}
             href="{{static_root_path|safe}}{{files.rust_favicon_png_32}}"> {# #}
         <link rel="icon" type="image/svg+xml" {#+ #}
-            href="{{static_root_path|safe}}{{files.rust_favicon_svg}}"> {# #}
+            href="{{static_root_path|safe}}{{files.rust_favicon_svg}}">
     {% endif %}
     {{ layout.external_html.in_header|safe }}
 </head> {# #}
@@ -69,60 +69,60 @@
     <div class="warning"> {# #}
         This old browser is unsupported and will most likely display funky things. {# #}
     </div> {# #}
-    <![endif]--> {# #}
+    <![endif]-->
     {{ layout.external_html.before_content|safe }}
     {% if page.css_class != "src" %}
     <nav class="mobile-topbar"> {# #}
-        <button class="sidebar-menu-toggle" title="show sidebar"></button> {# #}
+        <button class="sidebar-menu-toggle" title="show sidebar"></button>
         {% if !layout.logo.is_empty() || page.rust_logo %}
-        <a class="logo-container" href="{{page.root_path|safe}}{{display_krate_with_trailing_slash|safe}}index.html"> {# #}
+        <a class="logo-container" href="{{page.root_path|safe}}{{display_krate_with_trailing_slash|safe}}index.html">
         {% if page.rust_logo %}
-            <img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt=""> {# #}
+            <img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="">
         {% else if !layout.logo.is_empty() %}
-            <img src="{{layout.logo}}" alt=""> {# #}
+            <img src="{{layout.logo}}" alt="">
         {% endif %}
-        </a> {# #}
+        </a>
         {% endif %}
     </nav>
     {% endif %}
-    <nav class="sidebar"> {# #}
+    <nav class="sidebar">
         {% if page.css_class != "src" %}
         <div class="sidebar-crate">
             {% if !layout.logo.is_empty() || page.rust_logo %}
-            <a class="logo-container" href="{{page.root_path|safe}}{{display_krate_with_trailing_slash|safe}}index.html"> {# #}
+            <a class="logo-container" href="{{page.root_path|safe}}{{display_krate_with_trailing_slash|safe}}index.html">
                 {% if page.rust_logo %}
-                    <img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {# #}
+                    <img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo">
                 {% else if !layout.logo.is_empty() %}
-                    <img src="{{layout.logo}}" alt="logo"> {# #}
+                    <img src="{{layout.logo}}" alt="logo">
                 {% endif %}
-            </a> {# #}
+            </a>
             {% endif %}
             <h2> {# #}
-                <a href="{{page.root_path|safe}}{{display_krate_with_trailing_slash|safe}}index.html">{{display_krate|wrapped|safe}}</a> {# #}
+                <a href="{{page.root_path|safe}}{{display_krate_with_trailing_slash|safe}}index.html">{{display_krate|wrapped|safe}}</a>
                 {% if !display_krate_version_number.is_empty() %}
                     <span class="version">{{+ display_krate_version_number}}</span>
                 {% endif %}
             </h2> {# #}
-        </div> {# #}
+        </div>
         {% if !display_krate_version_extra.is_empty() %}
-        <div class="version">{{+ display_krate_version_extra}}</div> {# #}
+        <div class="version">{{+ display_krate_version_extra}}</div>
         {% endif %}
         {% else %}
         <div class="src-sidebar-title"> {# #}
             <h2>Files</h2> {# #}
-        </div> {# #}
+        </div>
         {% endif %}
         {{ sidebar|safe }}
     </nav> {# #}
     <div class="sidebar-resizer"></div> {# #}
-    <main> {# #}
+    <main>
         {% if page.css_class != "src" %}<div class="width-limiter">{% endif %}
             {# defined in storage.js to avoid duplicating complex UI across every page #}
             {# and because the search form only works if JS is enabled anyway #}
             <rustdoc-search></rustdoc-search> {# #}
-            <section id="main-content" class="content">{{ content|safe }}</section> {# #}
+            <section id="main-content" class="content">{{ content|safe }}</section>
         {% if page.css_class != "src" %}</div>{% endif %}
-    </main> {# #}
+    </main>
     {{ layout.external_html.after_content|safe }}
 </body> {# #}
 </html> {# #}
diff --git a/src/librustdoc/html/templates/print_item.html b/src/librustdoc/html/templates/print_item.html
index 32ded1fbe42..f60720b67c6 100644
--- a/src/librustdoc/html/templates/print_item.html
+++ b/src/librustdoc/html/templates/print_item.html
@@ -1,4 +1,4 @@
-<div class="main-heading"> {# #}
+<div class="main-heading">
     {% if !path_components.is_empty() %}
     <span class="rustdoc-breadcrumbs">
         {% for (i, component) in path_components.iter().enumerate() %}
diff --git a/src/librustdoc/html/templates/short_item_info.html b/src/librustdoc/html/templates/short_item_info.html
index 75d155e91c2..e76b98541cf 100644
--- a/src/librustdoc/html/templates/short_item_info.html
+++ b/src/librustdoc/html/templates/short_item_info.html
@@ -3,21 +3,21 @@
         <div class="stab deprecated"> {# #}
             <span class="emoji">👎</span> {# #}
             <span>{{message|safe}}</span> {# #}
-        </div> {# #}
+        </div>
     {% when Self::Unstable with { feature, tracking } %}
         <div class="stab unstable"> {# #}
             <span class="emoji">🔬</span> {# #}
             <span> {# #}
                 This is a nightly-only experimental API. ({# #}
-                <code>{{feature}}</code> {# #}
+                <code>{{feature}}</code>
                 {% match tracking %}
                     {% when Some with ((url, num)) %}
-                        &nbsp;<a href="{{url}}{{num}}">#{{num}}</a> {# #}
+                        &nbsp;<a href="{{url}}{{num}}">#{{num}}</a>
                     {% when None %}
                 {% endmatch %}
                 ) {# #}
             </span> {# #}
-        </div> {# #}
+        </div>
     {% when Self::Portability with { message } %}
-        <div class="stab portability">{{message|safe}}</div> {# #}
+        <div class="stab portability">{{message|safe}}</div>
 {% endmatch %}
diff --git a/src/librustdoc/html/templates/sidebar.html b/src/librustdoc/html/templates/sidebar.html
index fccf65cbefc..7f852b489fa 100644
--- a/src/librustdoc/html/templates/sidebar.html
+++ b/src/librustdoc/html/templates/sidebar.html
@@ -30,7 +30,7 @@
                                             {% else %}
                                                 {{link.name}}
                                         {% endmatch %}
-                                    </a> {# #}
+                                    </a>
                                     {% if !link.children.is_empty() %}
                                         <ul>
                                             {% for child in link.children %}
diff --git a/src/librustdoc/html/templates/source.html b/src/librustdoc/html/templates/source.html
index 9daa0cf8ff6..ea530087e6f 100644
--- a/src/librustdoc/html/templates/source.html
+++ b/src/librustdoc/html/templates/source.html
@@ -9,7 +9,7 @@
 </div>
 {% else %}
 {% endmatch %}
-<div class="example-wrap"> {# #}
+<div class="example-wrap">
     {# https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag#data-nosnippet-attr
        Do not show "1 2 3 4 5 ..." in web search results. #}
     <div data-nosnippet><pre class="src-line-numbers">
diff --git a/src/librustdoc/html/templates/type_layout.html b/src/librustdoc/html/templates/type_layout.html
index e0516bb42fe..aee96fb8c41 100644
--- a/src/librustdoc/html/templates/type_layout.html
+++ b/src/librustdoc/html/templates/type_layout.html
@@ -1,7 +1,7 @@
 <h2 id="layout" class="section-header"> {# #}
     Layout<a href="#layout" class="anchor">§</a> {# #}
 </h2> {# #}
-<div class="docblock"> {# #}
+<div class="docblock">
     {% match type_layout_size %}
     {% when Ok(type_layout_size) %}
     <div class="warning"> {# #}
@@ -14,19 +14,19 @@
             chapter for details on type layout guarantees. {# #}
         </p> {# #}
     </div> {# #}
-    <p><strong>Size:</strong> {{+ type_layout_size|safe }}</p> {# #}
+    <p><strong>Size:</strong> {{+ type_layout_size|safe }}</p>
     {% if !variants.is_empty() %}
     <p> {# #}
         <strong>Size for each variant:</strong> {# #}
     </p> {# #}
-    <ul> {# #}
+    <ul>
         {% for (name, layout_size) in variants %}
         <li> {# #}
             <code>{{ name }}</code>: {#+ #}
             {{ layout_size|safe }}
-        </li> {# #}
+        </li>
         {% endfor %}
-    </ul> {# #}
+    </ul>
     {% endif %}
     {# This kind of layout error can occur with valid code, e.g. if you try to
     get the layout of a generic type such as `Vec<T>`. #}
@@ -35,7 +35,7 @@
             <strong>Note:</strong> Unable to compute type layout, {#+ #}
             possibly due to this type having generic parameters. {#+ #}
             Layout can only be computed for concrete, fully-instantiated types. {# #}
-        </p> {# #}
+        </p>
         {# This kind of error probably can't happen with valid code, but we don't
         want to panic and prevent the docs from building, so we just let the
         user know that we couldn't compute the layout. #}
@@ -43,21 +43,21 @@
         <p> {# #}
             <strong>Note:</strong> Encountered an error during type layout; {#+ #}
             the type was too big. {# #}
-        </p> {# #}
+        </p>
         {% when Err(LayoutError::ReferencesError(_)) %}
         <p> {# #}
             <strong>Note:</strong> Encountered an error during type layout; {#+ #}
             the type references errors. {# #}
-        </p> {# #}
+        </p>
         {% when Err(LayoutError::NormalizationFailure(_, _)) %}
         <p> {# #}
             <strong>Note:</strong> Encountered an error during type layout; {#+ #}
             the type failed to be normalized. {# #}
-        </p> {# #}
+        </p>
         {% when Err(LayoutError::Cycle(_)) %}
         <p> {# #}
             <strong>Note:</strong> Encountered an error during type layout; {#+ #}
             the type's layout depended on the type's layout itself. {# #}
-        </p> {# #}
+        </p>
         {% endmatch %}
 </div> {# #}
diff --git a/src/tools/clippy/tests/ui/crashes/ice-6251.stderr b/src/tools/clippy/tests/ui/crashes/ice-6251.stderr
index 82e7d723586..77c3e6288ce 100644
--- a/src/tools/clippy/tests/ui/crashes/ice-6251.stderr
+++ b/src/tools/clippy/tests/ui/crashes/ice-6251.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> tests/ui/crashes/ice-6251.rs:4:45
+  --> tests/ui/crashes/ice-6251.rs:4:48
    |
 LL | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| x }]> {
-   |                                             ^ doesn't have a size known at compile-time
+   |                                                ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[u8]`
    = help: unsized fn params are gated as an unstable feature
diff --git a/src/tools/rustbook/Cargo.lock b/src/tools/rustbook/Cargo.lock
index 1394675a9dc..e5f0aabbf7c 100644
--- a/src/tools/rustbook/Cargo.lock
+++ b/src/tools/rustbook/Cargo.lock
@@ -3,10 +3,10 @@
 version = 3
 
 [[package]]
-name = "adler"
-version = "1.0.2"
+name = "adler2"
+version = "2.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
 
 [[package]]
 name = "aho-corasick"
@@ -47,9 +47,9 @@ dependencies = [
 
 [[package]]
 name = "anstream"
-version = "0.6.14"
+version = "0.6.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
+checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526"
 dependencies = [
  "anstyle",
  "anstyle-parse",
@@ -62,33 +62,33 @@ dependencies = [
 
 [[package]]
 name = "anstyle"
-version = "1.0.7"
+version = "1.0.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
+checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
 
 [[package]]
 name = "anstyle-parse"
-version = "0.2.4"
+version = "0.2.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
+checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb"
 dependencies = [
  "utf8parse",
 ]
 
 [[package]]
 name = "anstyle-query"
-version = "1.1.0"
+version = "1.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391"
+checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a"
 dependencies = [
  "windows-sys 0.52.0",
 ]
 
 [[package]]
 name = "anstyle-wincon"
-version = "3.0.3"
+version = "3.0.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
+checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8"
 dependencies = [
  "anstyle",
  "windows-sys 0.52.0",
@@ -96,9 +96,9 @@ dependencies = [
 
 [[package]]
 name = "anyhow"
-version = "1.0.86"
+version = "1.0.89"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
+checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6"
 
 [[package]]
 name = "autocfg"
@@ -107,12 +107,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
 
 [[package]]
-name = "base64"
-version = "0.22.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
-
-[[package]]
 name = "bincode"
 version = "1.3.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -144,9 +138,9 @@ dependencies = [
 
 [[package]]
 name = "bstr"
-version = "1.9.1"
+version = "1.10.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706"
+checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c"
 dependencies = [
  "memchr",
  "regex-automata",
@@ -160,10 +154,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
 
 [[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
+[[package]]
 name = "cc"
-version = "1.1.5"
+version = "1.1.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052"
+checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0"
+dependencies = [
+ "shlex",
+]
 
 [[package]]
 name = "cfg-if"
@@ -179,15 +182,17 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
 dependencies = [
  "android-tzdata",
  "iana-time-zone",
+ "js-sys",
  "num-traits",
+ "wasm-bindgen",
  "windows-targets 0.52.6",
 ]
 
 [[package]]
 name = "clap"
-version = "4.5.9"
+version = "4.5.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462"
+checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3"
 dependencies = [
  "clap_builder",
  "clap_derive",
@@ -195,9 +200,9 @@ dependencies = [
 
 [[package]]
 name = "clap_builder"
-version = "4.5.9"
+version = "4.5.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942"
+checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b"
 dependencies = [
  "anstream",
  "anstyle",
@@ -208,18 +213,18 @@ dependencies = [
 
 [[package]]
 name = "clap_complete"
-version = "4.5.8"
+version = "4.5.29"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b4be9c4c4b1f30b78d8a750e0822b6a6102d97e62061c583a6c1dea2dfb33ae"
+checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e"
 dependencies = [
  "clap",
 ]
 
 [[package]]
 name = "clap_derive"
-version = "4.5.8"
+version = "4.5.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085"
+checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab"
 dependencies = [
  "heck",
  "proc-macro2",
@@ -229,27 +234,27 @@ dependencies = [
 
 [[package]]
 name = "clap_lex"
-version = "0.7.1"
+version = "0.7.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
+checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
 
 [[package]]
 name = "colorchoice"
-version = "1.0.1"
+version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
+checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
 
 [[package]]
 name = "core-foundation-sys"
-version = "0.8.6"
+version = "0.8.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
 
 [[package]]
 name = "cpufeatures"
-version = "0.2.12"
+version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
+checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0"
 dependencies = [
  "libc",
 ]
@@ -274,6 +279,18 @@ dependencies = [
 ]
 
 [[package]]
+name = "dateparser"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2ef451feee09ae5ecd8a02e738bd9adee9266b8fa9b44e22d3ce968d8694238"
+dependencies = [
+ "anyhow",
+ "chrono",
+ "lazy_static",
+ "regex",
+]
+
+[[package]]
 name = "dbus"
 version = "0.9.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -285,15 +302,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "deranged"
-version = "0.3.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
-dependencies = [
- "powerfmt",
-]
-
-[[package]]
 name = "digest"
 version = "0.10.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -323,9 +331,9 @@ dependencies = [
 
 [[package]]
 name = "env_filter"
-version = "0.1.0"
+version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea"
+checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab"
 dependencies = [
  "log",
  "regex",
@@ -333,9 +341,9 @@ dependencies = [
 
 [[package]]
 name = "env_logger"
-version = "0.11.3"
+version = "0.11.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9"
+checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d"
 dependencies = [
  "anstream",
  "anstyle",
@@ -362,15 +370,15 @@ dependencies = [
 
 [[package]]
 name = "fastrand"
-version = "2.1.0"
+version = "2.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
+checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
 
 [[package]]
 name = "flate2"
-version = "1.0.30"
+version = "1.0.33"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae"
+checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253"
 dependencies = [
  "crc32fast",
  "miniz_oxide",
@@ -494,9 +502,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
 
 [[package]]
 name = "iana-time-zone"
-version = "0.1.60"
+version = "0.1.61"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141"
+checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
 dependencies = [
  "android_system_properties",
  "core-foundation-sys",
@@ -527,9 +535,9 @@ dependencies = [
 
 [[package]]
 name = "indexmap"
-version = "2.2.6"
+version = "2.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
+checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5"
 dependencies = [
  "equivalent",
  "hashbrown",
@@ -537,9 +545,9 @@ dependencies = [
 
 [[package]]
 name = "is_terminal_polyfill"
-version = "1.70.0"
+version = "1.70.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
+checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
 
 [[package]]
 name = "itoa"
@@ -549,18 +557,24 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
 
 [[package]]
 name = "js-sys"
-version = "0.3.69"
+version = "0.3.70"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
+checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
 dependencies = [
  "wasm-bindgen",
 ]
 
 [[package]]
+name = "lazy_static"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
+
+[[package]]
 name = "libc"
-version = "0.2.155"
+version = "0.2.158"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
+checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
 
 [[package]]
 name = "libdbus-sys"
@@ -582,12 +596,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "linked-hash-map"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
-
-[[package]]
 name = "linux-raw-sys"
 version = "0.4.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -653,7 +661,7 @@ dependencies = [
  "memchr",
  "once_cell",
  "opener",
- "pulldown-cmark",
+ "pulldown-cmark 0.10.3",
  "regex",
  "serde",
  "serde_json",
@@ -665,16 +673,17 @@ dependencies = [
 
 [[package]]
 name = "mdbook-i18n-helpers"
-version = "0.3.4"
+version = "0.3.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c8f972ab672d366c3dad77ea5aa7bae68db2d25fbeb889849f97469d7b658e4"
+checksum = "7cac78e4f518f326e5fc1ff95e79e7e0e58330cb8ac6e4b559d9659cf69bb1ab"
 dependencies = [
  "anyhow",
  "chrono",
+ "dateparser",
  "mdbook",
  "polib",
- "pulldown-cmark",
- "pulldown-cmark-to-cmark",
+ "pulldown-cmark 0.11.3",
+ "pulldown-cmark-to-cmark 15.0.1",
  "regex",
  "semver",
  "serde_json",
@@ -690,7 +699,7 @@ dependencies = [
  "mdbook",
  "once_cell",
  "pathdiff",
- "pulldown-cmark",
+ "pulldown-cmark 0.10.3",
  "regex",
  "semver",
  "serde_json",
@@ -704,11 +713,11 @@ dependencies = [
  "clap",
  "html_parser",
  "mdbook",
- "pulldown-cmark",
- "pulldown-cmark-to-cmark",
+ "pulldown-cmark 0.10.3",
+ "pulldown-cmark-to-cmark 13.0.0",
  "serde_json",
  "thiserror",
- "toml 0.8.14",
+ "toml 0.8.19",
 ]
 
 [[package]]
@@ -717,8 +726,8 @@ version = "1.0.0"
 dependencies = [
  "clap",
  "mdbook",
- "pulldown-cmark",
- "pulldown-cmark-to-cmark",
+ "pulldown-cmark 0.10.3",
+ "pulldown-cmark-to-cmark 13.0.0",
  "serde_json",
 ]
 
@@ -730,11 +739,11 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
 
 [[package]]
 name = "miniz_oxide"
-version = "0.7.4"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
+checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
 dependencies = [
- "adler",
+ "adler2",
 ]
 
 [[package]]
@@ -745,20 +754,14 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
 
 [[package]]
 name = "normpath"
-version = "1.2.0"
+version = "1.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804"
+checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed"
 dependencies = [
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
 ]
 
 [[package]]
-name = "num-conv"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
-
-[[package]]
 name = "num-traits"
 version = "0.2.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -797,14 +800,14 @@ dependencies = [
 
 [[package]]
 name = "opener"
-version = "0.7.1"
+version = "0.7.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8df34be653210fbe9ffaff41d3b92721c56ce82dfee58ee684f9afb5e3a90c0"
+checksum = "d0812e5e4df08da354c851a3376fead46db31c2214f849d3de356d774d057681"
 dependencies = [
  "bstr",
  "dbus",
  "normpath",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
 ]
 
 [[package]]
@@ -844,9 +847,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
 
 [[package]]
 name = "pest"
-version = "2.7.11"
+version = "2.7.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95"
+checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9"
 dependencies = [
  "memchr",
  "thiserror",
@@ -855,9 +858,9 @@ dependencies = [
 
 [[package]]
 name = "pest_derive"
-version = "2.7.11"
+version = "2.7.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a"
+checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0"
 dependencies = [
  "pest",
  "pest_generator",
@@ -865,9 +868,9 @@ dependencies = [
 
 [[package]]
 name = "pest_generator"
-version = "2.7.11"
+version = "2.7.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183"
+checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e"
 dependencies = [
  "pest",
  "pest_meta",
@@ -878,9 +881,9 @@ dependencies = [
 
 [[package]]
 name = "pest_meta"
-version = "2.7.11"
+version = "2.7.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f"
+checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f"
 dependencies = [
  "once_cell",
  "pest",
@@ -951,19 +954,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
 
 [[package]]
-name = "plist"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016"
-dependencies = [
- "base64",
- "indexmap",
- "quick-xml",
- "serde",
- "time",
-]
-
-[[package]]
 name = "polib"
 version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -973,16 +963,13 @@ dependencies = [
 ]
 
 [[package]]
-name = "powerfmt"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
-
-[[package]]
 name = "ppv-lite86"
-version = "0.2.17"
+version = "0.2.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
+dependencies = [
+ "zerocopy",
+]
 
 [[package]]
 name = "precomputed-hash"
@@ -1008,7 +995,19 @@ dependencies = [
  "bitflags 2.6.0",
  "getopts",
  "memchr",
- "pulldown-cmark-escape",
+ "pulldown-cmark-escape 0.10.1",
+ "unicase",
+]
+
+[[package]]
+name = "pulldown-cmark"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "679341d22c78c6c649893cbd6c3278dcbe9fc4faa62fea3a9296ae2b50c14625"
+dependencies = [
+ "bitflags 2.6.0",
+ "memchr",
+ "pulldown-cmark-escape 0.11.0",
  "unicase",
 ]
 
@@ -1019,28 +1018,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3"
 
 [[package]]
+name = "pulldown-cmark-escape"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae"
+
+[[package]]
 name = "pulldown-cmark-to-cmark"
 version = "13.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "f609795c8d835f79dcfcf768415b9fb57ef1b74891e99f86e73f43a7a257163b"
 dependencies = [
- "pulldown-cmark",
+ "pulldown-cmark 0.10.3",
 ]
 
 [[package]]
-name = "quick-xml"
-version = "0.32.0"
+name = "pulldown-cmark-to-cmark"
+version = "15.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2"
+checksum = "b9c77db841443d89a57ae94f22d29c022f6d9f41b00bddbf1f4024dbaf4bdce1"
 dependencies = [
- "memchr",
+ "pulldown-cmark 0.11.3",
 ]
 
 [[package]]
 name = "quote"
-version = "1.0.36"
+version = "1.0.37"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
+checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
 dependencies = [
  "proc-macro2",
 ]
@@ -1077,18 +1082,18 @@ dependencies = [
 
 [[package]]
 name = "redox_syscall"
-version = "0.5.3"
+version = "0.5.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4"
+checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853"
 dependencies = [
  "bitflags 2.6.0",
 ]
 
 [[package]]
 name = "regex"
-version = "1.10.5"
+version = "1.10.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
+checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619"
 dependencies = [
  "aho-corasick",
  "memchr",
@@ -1128,9 +1133,9 @@ dependencies = [
 
 [[package]]
 name = "rustix"
-version = "0.38.34"
+version = "0.38.37"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
+checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
 dependencies = [
  "bitflags 2.6.0",
  "errno",
@@ -1168,18 +1173,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
 
 [[package]]
 name = "serde"
-version = "1.0.204"
+version = "1.0.210"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
+checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
 dependencies = [
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.204"
+version = "1.0.210"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
+checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1188,20 +1193,21 @@ dependencies = [
 
 [[package]]
 name = "serde_json"
-version = "1.0.120"
+version = "1.0.128"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
+checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
 dependencies = [
  "itoa",
+ "memchr",
  "ryu",
  "serde",
 ]
 
 [[package]]
 name = "serde_spanned"
-version = "0.6.6"
+version = "0.6.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0"
+checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d"
 dependencies = [
  "serde",
 ]
@@ -1269,9 +1275,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
 
 [[package]]
 name = "syn"
-version = "2.0.71"
+version = "2.0.77"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462"
+checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1290,26 +1296,25 @@ dependencies = [
  "fnv",
  "once_cell",
  "onig",
- "plist",
  "regex-syntax",
  "serde",
  "serde_derive",
  "serde_json",
  "thiserror",
  "walkdir",
- "yaml-rust",
 ]
 
 [[package]]
 name = "tempfile"
-version = "3.10.1"
+version = "3.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
+checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64"
 dependencies = [
  "cfg-if",
  "fastrand",
+ "once_cell",
  "rustix",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
 ]
 
 [[package]]
@@ -1341,18 +1346,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
 
 [[package]]
 name = "thiserror"
-version = "1.0.62"
+version = "1.0.63"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb"
+checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
 dependencies = [
  "thiserror-impl",
 ]
 
 [[package]]
 name = "thiserror-impl"
-version = "1.0.62"
+version = "1.0.63"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c"
+checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1360,37 +1365,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "time"
-version = "0.3.36"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
-dependencies = [
- "deranged",
- "itoa",
- "num-conv",
- "powerfmt",
- "serde",
- "time-core",
- "time-macros",
-]
-
-[[package]]
-name = "time-core"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
-
-[[package]]
-name = "time-macros"
-version = "0.2.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
-dependencies = [
- "num-conv",
- "time-core",
-]
-
-[[package]]
 name = "tinyvec"
 version = "1.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1416,9 +1390,9 @@ dependencies = [
 
 [[package]]
 name = "toml"
-version = "0.8.14"
+version = "0.8.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335"
+checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
 dependencies = [
  "serde",
  "serde_spanned",
@@ -1428,18 +1402,18 @@ dependencies = [
 
 [[package]]
 name = "toml_datetime"
-version = "0.6.6"
+version = "0.6.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf"
+checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
 dependencies = [
  "serde",
 ]
 
 [[package]]
 name = "toml_edit"
-version = "0.22.15"
+version = "0.22.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1"
+checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf"
 dependencies = [
  "indexmap",
  "serde",
@@ -1483,24 +1457,24 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
 
 [[package]]
 name = "unicode-ident"
-version = "1.0.12"
+version = "1.0.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
 
 [[package]]
 name = "unicode-normalization"
-version = "0.1.23"
+version = "0.1.24"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5"
+checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956"
 dependencies = [
  "tinyvec",
 ]
 
 [[package]]
 name = "unicode-width"
-version = "0.1.13"
+version = "0.1.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
+checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
 
 [[package]]
 name = "url"
@@ -1527,9 +1501,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
 
 [[package]]
 name = "version_check"
-version = "0.9.4"
+version = "0.9.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
 
 [[package]]
 name = "walkdir"
@@ -1549,19 +1523,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 
 [[package]]
 name = "wasm-bindgen"
-version = "0.2.92"
+version = "0.2.93"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
+checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
 dependencies = [
  "cfg-if",
+ "once_cell",
  "wasm-bindgen-macro",
 ]
 
 [[package]]
 name = "wasm-bindgen-backend"
-version = "0.2.92"
+version = "0.2.93"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
+checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
 dependencies = [
  "bumpalo",
  "log",
@@ -1574,9 +1549,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro"
-version = "0.2.92"
+version = "0.2.93"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
+checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
 dependencies = [
  "quote",
  "wasm-bindgen-macro-support",
@@ -1584,9 +1559,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro-support"
-version = "0.2.92"
+version = "0.2.93"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
+checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1597,9 +1572,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-shared"
-version = "0.2.92"
+version = "0.2.93"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
+checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
 
 [[package]]
 name = "winapi"
@@ -1619,11 +1594,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
 
 [[package]]
 name = "winapi-util"
-version = "0.1.8"
+version = "0.1.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b"
+checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
 dependencies = [
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
 ]
 
 [[package]]
@@ -1660,6 +1635,15 @@ dependencies = [
 ]
 
 [[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets 0.52.6",
+]
+
+[[package]]
 name = "windows-targets"
 version = "0.48.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1782,18 +1766,30 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
 
 [[package]]
 name = "winnow"
-version = "0.6.13"
+version = "0.6.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
+checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
 dependencies = [
  "memchr",
 ]
 
 [[package]]
-name = "yaml-rust"
-version = "0.4.5"
+name = "zerocopy"
+version = "0.7.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
+dependencies = [
+ "byteorder",
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.7.35"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
+checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
 dependencies = [
- "linked-hash-map",
+ "proc-macro2",
+ "quote",
+ "syn",
 ]
diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt
index 6b4c0e9c0b9..2071abefbe1 100644
--- a/src/tools/tidy/src/issues.txt
+++ b/src/tools/tidy/src/issues.txt
@@ -4076,7 +4076,6 @@ ui/traits/issue-96664.rs
 ui/traits/issue-96665.rs
 ui/traits/issue-97576.rs
 ui/traits/issue-97695-double-trivial-bound.rs
-ui/traits/issue-99875.rs
 ui/traits/next-solver/coherence/issue-102048.rs
 ui/traits/next-solver/issue-118950-root-region.rs
 ui/traits/object/issue-33140-traitobject-crate.rs
diff --git a/src/tools/tidy/src/rustdoc_templates.rs b/src/tools/tidy/src/rustdoc_templates.rs
index 6c8530e6366..2173dbf7e74 100644
--- a/src/tools/tidy/src/rustdoc_templates.rs
+++ b/src/tools/tidy/src/rustdoc_templates.rs
@@ -20,7 +20,39 @@ pub fn check(librustdoc_path: &Path, bad: &mut bool) {
 
             while let Some((pos, line)) = lines.next() {
                 let line = line.trim();
-                if TAGS.iter().any(|(_, tag)| line.ends_with(tag)) {
+                if let Some(need_next_line_check) = TAGS.iter().find_map(|(tag, end_tag)| {
+                    // We first check if the line ends with a jinja tag.
+                    if !line.ends_with(end_tag) {
+                        return None;
+                    // Then we check if this a comment tag.
+                    } else if *tag != "{#" {
+                        return Some(false);
+                    // And finally we check if the comment is empty (ie, only there to strip
+                    // extra whitespace characters).
+                    } else if let Some(start_pos) = line.rfind(tag) {
+                        Some(line[start_pos + 2..].trim() == "#}")
+                    } else {
+                        Some(false)
+                    }
+                }) {
+                    // All good, the line is ending is a jinja tag. But maybe this tag is useless
+                    // if the next line starts with a jinja tag as well!
+                    //
+                    // However, only (empty) comment jinja tags are concerned about it.
+                    if need_next_line_check
+                        && lines.peek().is_some_and(|(_, next_line)| {
+                            let next_line = next_line.trim_start();
+                            TAGS.iter().any(|(tag, _)| next_line.starts_with(tag))
+                        })
+                    {
+                        // It seems like ending this line with a jinja tag is not needed after all.
+                        tidy_error!(
+                            bad,
+                            "`{}` at line {}: unneeded `{{# #}}` tag at the end of the line",
+                            path.path().display(),
+                            pos + 1,
+                        );
+                    }
                     continue;
                 }
                 let Some(next_line) = lines.peek().map(|(_, next_line)| next_line.trim()) else {
diff --git a/tests/ui/associated-types/issue-59324.stderr b/tests/ui/associated-types/issue-59324.stderr
index f50d86580f8..6c77ee6044f 100644
--- a/tests/ui/associated-types/issue-59324.stderr
+++ b/tests/ui/associated-types/issue-59324.stderr
@@ -79,10 +79,10 @@ LL | pub trait Foo: NotFoo {
    | ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time
-  --> $DIR/issue-59324.rs:23:20
+  --> $DIR/issue-59324.rs:23:29
    |
 LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
-   |                    ^^^^^^^ doesn't have a size known at compile-time
+   |                             ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn ThriftService<(), AssocType = _> + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/coherence/occurs-check/opaques.next.stderr b/tests/ui/coherence/occurs-check/opaques.next.stderr
index 11d1edcca2f..757219398f1 100644
--- a/tests/ui/coherence/occurs-check/opaques.next.stderr
+++ b/tests/ui/coherence/occurs-check/opaques.next.stderr
@@ -8,10 +8,10 @@ LL | impl<T> Trait<T> for defining_scope::Alias<T> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error[E0282]: type annotations needed
-  --> $DIR/opaques.rs:13:20
+  --> $DIR/opaques.rs:13:23
    |
 LL |     pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> {
-   |                    ^ cannot infer type
+   |                       ^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr b/tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr
index 6f38def6998..96742f8bf47 100644
--- a/tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr
+++ b/tests/ui/did_you_mean/replace-impl-infer-ty-from-trait.stderr
@@ -14,10 +14,10 @@ LL |     fn bar(i: i32, t: usize, s: &()) -> (usize, i32) {
    |               ~~~     ~~~~~     ~~~     ~~~~~~~~~~~~
 
 error[E0282]: type annotations needed
-  --> $DIR/replace-impl-infer-ty-from-trait.rs:9:12
+  --> $DIR/replace-impl-infer-ty-from-trait.rs:9:15
    |
 LL |     fn bar(i: _, t: _, s: _) -> _ {
-   |            ^ cannot infer type
+   |               ^ cannot infer type
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/error-codes/E0277.stderr b/tests/ui/error-codes/E0277.stderr
index aeb97290cf8..52ada36574e 100644
--- a/tests/ui/error-codes/E0277.stderr
+++ b/tests/ui/error-codes/E0277.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/E0277.rs:11:6
+  --> $DIR/E0277.rs:11:9
    |
 LL | fn f(p: Path) { }
-   |      ^ doesn't have a size known at compile-time
+   |         ^^^^ doesn't have a size known at compile-time
    |
    = help: within `Path`, the trait `Sized` is not implemented for `[u8]`, which is required by `Path: Sized`
 note: required because it appears within the type `Path`
diff --git a/tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr b/tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr
index b11c30eaad4..360c73ae2d7 100644
--- a/tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr
+++ b/tests/ui/feature-gates/feature-gate-unsized_fn_params.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
-  --> $DIR/feature-gate-unsized_fn_params.rs:17:8
+  --> $DIR/feature-gate-unsized_fn_params.rs:17:11
    |
 LL | fn foo(x: dyn Foo) {
-   |        ^ doesn't have a size known at compile-time
+   |           ^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)`
    = help: unsized fn params are gated as an unstable feature
@@ -16,10 +16,10 @@ LL | fn foo(x: &dyn Foo) {
    |           +
 
 error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
-  --> $DIR/feature-gate-unsized_fn_params.rs:21:8
+  --> $DIR/feature-gate-unsized_fn_params.rs:21:11
    |
 LL | fn bar(x: Foo) {
-   |        ^ doesn't have a size known at compile-time
+   |           ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)`
    = help: unsized fn params are gated as an unstable feature
@@ -33,10 +33,10 @@ LL | fn bar(x: &dyn Foo) {
    |           ++++
 
 error[E0277]: the size for values of type `[()]` cannot be known at compilation time
-  --> $DIR/feature-gate-unsized_fn_params.rs:25:8
+  --> $DIR/feature-gate-unsized_fn_params.rs:25:11
    |
 LL | fn qux(_: [()]) {}
-   |        ^ doesn't have a size known at compile-time
+   |           ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[()]`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/feature-gates/feature-gate-unsized_locals.stderr b/tests/ui/feature-gates/feature-gate-unsized_locals.stderr
index f1595e034be..f48565b922b 100644
--- a/tests/ui/feature-gates/feature-gate-unsized_locals.stderr
+++ b/tests/ui/feature-gates/feature-gate-unsized_locals.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `(dyn FnOnce() + 'static)` cannot be known at compilation time
-  --> $DIR/feature-gate-unsized_locals.rs:1:6
+  --> $DIR/feature-gate-unsized_locals.rs:1:9
    |
 LL | fn f(f: dyn FnOnce()) {}
-   |      ^ doesn't have a size known at compile-time
+   |         ^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn FnOnce() + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr b/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr
index a5cd057e284..ce01e24770d 100644
--- a/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr
+++ b/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr
@@ -36,10 +36,10 @@ LL | struct Query<'q> {}
    = help: consider removing `'q`, referring to it in a field, or using a marker such as `PhantomData`
 
 error[E0277]: the size for values of type `Self` cannot be known at compilation time
-  --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:7:17
+  --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:7:21
    |
 LL |     fn for_each(mut self, mut f: Box<dyn FnMut(Self::Item<'_>) + 'static>) {}
-   |                 ^^^^^^^^ doesn't have a size known at compile-time
+   |                     ^^^^ doesn't have a size known at compile-time
    |
    = help: unsized fn params are gated as an unstable feature
 help: consider further restricting `Self`
diff --git a/tests/ui/issues/issue-38954.stderr b/tests/ui/issues/issue-38954.stderr
index 4dd83ddf32d..bd9c5e4197b 100644
--- a/tests/ui/issues/issue-38954.stderr
+++ b/tests/ui/issues/issue-38954.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/issue-38954.rs:1:10
+  --> $DIR/issue-38954.rs:1:18
    |
 LL | fn _test(ref _p: str) {}
-   |          ^^^^^^ doesn't have a size known at compile-time
+   |                  ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/issues/issue-41229-ref-str.stderr b/tests/ui/issues/issue-41229-ref-str.stderr
index afc2cac7343..d4ef2a77725 100644
--- a/tests/ui/issues/issue-41229-ref-str.stderr
+++ b/tests/ui/issues/issue-41229-ref-str.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/issue-41229-ref-str.rs:1:16
+  --> $DIR/issue-41229-ref-str.rs:1:23
    |
 LL | pub fn example(ref s: str) {}
-   |                ^^^^^ doesn't have a size known at compile-time
+   |                       ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/issues/issue-42312.stderr b/tests/ui/issues/issue-42312.stderr
index 3ca6a2957e1..cbdc9ce0f83 100644
--- a/tests/ui/issues/issue-42312.stderr
+++ b/tests/ui/issues/issue-42312.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `<Self as Deref>::Target` cannot be known at compilation time
-  --> $DIR/issue-42312.rs:4:12
+  --> $DIR/issue-42312.rs:4:15
    |
 LL |     fn baz(_: Self::Target) where Self: Deref {}
-   |            ^ doesn't have a size known at compile-time
+   |               ^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `<Self as Deref>::Target`
    = help: unsized fn params are gated as an unstable feature
@@ -16,10 +16,10 @@ LL |     fn baz(_: &Self::Target) where Self: Deref {}
    |               +
 
 error[E0277]: the size for values of type `(dyn ToString + 'static)` cannot be known at compilation time
-  --> $DIR/issue-42312.rs:8:10
+  --> $DIR/issue-42312.rs:8:13
    |
 LL | pub fn f(_: dyn ToString) {}
-   |          ^ doesn't have a size known at compile-time
+   |             ^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn ToString + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/issues/issue-5883.stderr b/tests/ui/issues/issue-5883.stderr
index 51d9708e0fa..d481d0ef94e 100644
--- a/tests/ui/issues/issue-5883.stderr
+++ b/tests/ui/issues/issue-5883.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
-  --> $DIR/issue-5883.rs:8:5
+  --> $DIR/issue-5883.rs:8:8
    |
 LL |     r: dyn A + 'static
-   |     ^ doesn't have a size known at compile-time
+   |        ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn A + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/issues/issue-66706.stderr b/tests/ui/issues/issue-66706.stderr
index dd1e07589f5..cfe85764000 100644
--- a/tests/ui/issues/issue-66706.stderr
+++ b/tests/ui/issues/issue-66706.stderr
@@ -29,10 +29,10 @@ LL |     [0; match [|f @ &ref _| () ] {} ]
    |         while parsing this `match` expression
 
 error[E0282]: type annotations needed
-  --> $DIR/issue-66706.rs:2:11
+  --> $DIR/issue-66706.rs:2:14
    |
 LL |     [0; [|_: _ &_| ()].len()]
-   |           ^ cannot infer type
+   |              ^ cannot infer type
 
 error[E0282]: type annotations needed
   --> $DIR/issue-66706.rs:13:11
diff --git a/tests/ui/object-safety/avoid-ice-on-warning-2.new.stderr b/tests/ui/object-safety/avoid-ice-on-warning-2.new.stderr
index 0bc396390d7..811b9ac187b 100644
--- a/tests/ui/object-safety/avoid-ice-on-warning-2.new.stderr
+++ b/tests/ui/object-safety/avoid-ice-on-warning-2.new.stderr
@@ -19,10 +19,10 @@ LL |     f()
    |     call expression requires function
 
 error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time
-  --> $DIR/avoid-ice-on-warning-2.rs:4:10
+  --> $DIR/avoid-ice-on-warning-2.rs:4:13
    |
 LL | fn id<F>(f: Copy) -> usize {
-   |          ^ doesn't have a size known at compile-time
+   |             ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Copy + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/object-safety/avoid-ice-on-warning-2.old.stderr b/tests/ui/object-safety/avoid-ice-on-warning-2.old.stderr
index f1f33a6c6d6..dd4c7647e24 100644
--- a/tests/ui/object-safety/avoid-ice-on-warning-2.old.stderr
+++ b/tests/ui/object-safety/avoid-ice-on-warning-2.old.stderr
@@ -47,10 +47,10 @@ LL |     f()
    |     call expression requires function
 
 error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time
-  --> $DIR/avoid-ice-on-warning-2.rs:4:10
+  --> $DIR/avoid-ice-on-warning-2.rs:4:13
    |
 LL | fn id<F>(f: Copy) -> usize {
-   |          ^ doesn't have a size known at compile-time
+   |             ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Copy + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/resolve/issue-3907-2.stderr b/tests/ui/resolve/issue-3907-2.stderr
index 364edb788c6..b252e45e6b2 100644
--- a/tests/ui/resolve/issue-3907-2.stderr
+++ b/tests/ui/resolve/issue-3907-2.stderr
@@ -11,10 +11,10 @@ LL |     fn bar();
    |        ^^^ the trait cannot be made into an object because associated function `bar` has no `self` parameter
 
 error[E0277]: the size for values of type `(dyn issue_3907::Foo + 'static)` cannot be known at compilation time
-  --> $DIR/issue-3907-2.rs:11:8
+  --> $DIR/issue-3907-2.rs:11:12
    |
 LL | fn bar(_x: Foo) {}
-   |        ^^ doesn't have a size known at compile-time
+   |            ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn issue_3907::Foo + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/resolve/issue-5035-2.stderr b/tests/ui/resolve/issue-5035-2.stderr
index 30721c0a206..ade0d6b4a35 100644
--- a/tests/ui/resolve/issue-5035-2.stderr
+++ b/tests/ui/resolve/issue-5035-2.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `(dyn I + 'static)` cannot be known at compilation time
-  --> $DIR/issue-5035-2.rs:4:8
+  --> $DIR/issue-5035-2.rs:4:12
    |
 LL | fn foo(_x: K) {}
-   |        ^^ doesn't have a size known at compile-time
+   |            ^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn I + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/suggestions/object-unsafe-trait-references-self.stderr b/tests/ui/suggestions/object-unsafe-trait-references-self.stderr
index 64270068471..f6530200d22 100644
--- a/tests/ui/suggestions/object-unsafe-trait-references-self.stderr
+++ b/tests/ui/suggestions/object-unsafe-trait-references-self.stderr
@@ -32,10 +32,10 @@ LL | trait Other: Sized {}
    |       this trait cannot be made into an object...
 
 error[E0277]: the size for values of type `Self` cannot be known at compilation time
-  --> $DIR/object-unsafe-trait-references-self.rs:2:19
+  --> $DIR/object-unsafe-trait-references-self.rs:2:22
    |
 LL |     fn baz(&self, _: Self) {}
-   |                   ^ doesn't have a size known at compile-time
+   |                      ^^^^ doesn't have a size known at compile-time
    |
    = help: unsized fn params are gated as an unstable feature
 help: consider further restricting `Self`
diff --git a/tests/ui/suggestions/path-by-value.stderr b/tests/ui/suggestions/path-by-value.stderr
index 46002d4e257..62feafe534d 100644
--- a/tests/ui/suggestions/path-by-value.stderr
+++ b/tests/ui/suggestions/path-by-value.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/path-by-value.rs:3:6
+  --> $DIR/path-by-value.rs:3:9
    |
 LL | fn f(p: Path) { }
-   |      ^ doesn't have a size known at compile-time
+   |         ^^^^ doesn't have a size known at compile-time
    |
    = help: within `Path`, the trait `Sized` is not implemented for `[u8]`, which is required by `Path: Sized`
 note: required because it appears within the type `Path`
diff --git a/tests/ui/suggestions/unsized-function-parameter.stderr b/tests/ui/suggestions/unsized-function-parameter.stderr
index 55d8d1ab1bc..4513a22bf15 100644
--- a/tests/ui/suggestions/unsized-function-parameter.stderr
+++ b/tests/ui/suggestions/unsized-function-parameter.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/unsized-function-parameter.rs:5:9
+  --> $DIR/unsized-function-parameter.rs:5:14
    |
 LL | fn foo1(bar: str) {}
-   |         ^^^ doesn't have a size known at compile-time
+   |              ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = help: unsized fn params are gated as an unstable feature
@@ -12,10 +12,10 @@ LL | fn foo1(bar: &str) {}
    |              +
 
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/unsized-function-parameter.rs:11:9
+  --> $DIR/unsized-function-parameter.rs:11:15
    |
 LL | fn foo2(_bar: str) {}
-   |         ^^^^ doesn't have a size known at compile-time
+   |               ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = help: unsized fn params are gated as an unstable feature
@@ -25,10 +25,10 @@ LL | fn foo2(_bar: &str) {}
    |               +
 
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/unsized-function-parameter.rs:17:9
+  --> $DIR/unsized-function-parameter.rs:17:12
    |
 LL | fn foo3(_: str) {}
-   |         ^ doesn't have a size known at compile-time
+   |            ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/trait-bounds/apit-unsized.stderr b/tests/ui/trait-bounds/apit-unsized.stderr
index 0f2dc52599f..6b68178757b 100644
--- a/tests/ui/trait-bounds/apit-unsized.stderr
+++ b/tests/ui/trait-bounds/apit-unsized.stderr
@@ -1,10 +1,11 @@
 error[E0277]: the size for values of type `impl Iterator<Item = i32> + ?Sized` cannot be known at compilation time
-  --> $DIR/apit-unsized.rs:1:8
+  --> $DIR/apit-unsized.rs:1:11
    |
 LL | fn foo(_: impl Iterator<Item = i32> + ?Sized) {}
-   |        ^  ---------------------------------- this type parameter needs to be `Sized`
-   |        |
-   |        doesn't have a size known at compile-time
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |           |
+   |           doesn't have a size known at compile-time
+   |           this type parameter needs to be `Sized`
    |
    = help: unsized fn params are gated as an unstable feature
 help: consider removing the `?Sized` bound to make the type parameter `Sized`
@@ -18,12 +19,13 @@ LL | fn foo(_: &impl Iterator<Item = i32> + ?Sized) {}
    |           +
 
 error[E0277]: the size for values of type `impl ?Sized` cannot be known at compilation time
-  --> $DIR/apit-unsized.rs:2:8
+  --> $DIR/apit-unsized.rs:2:11
    |
 LL | fn bar(_: impl ?Sized) {}
-   |        ^  ----------- this type parameter needs to be `Sized`
-   |        |
-   |        doesn't have a size known at compile-time
+   |           ^^^^^^^^^^^
+   |           |
+   |           doesn't have a size known at compile-time
+   |           this type parameter needs to be `Sized`
    |
    = help: unsized fn params are gated as an unstable feature
 help: consider replacing `?Sized` with `Sized`
diff --git a/tests/ui/trait-bounds/bad-suggestionf-for-repeated-unsized-bound-127441.stderr b/tests/ui/trait-bounds/bad-suggestionf-for-repeated-unsized-bound-127441.stderr
index 3e8f45ee9fc..363f52d6df8 100644
--- a/tests/ui/trait-bounds/bad-suggestionf-for-repeated-unsized-bound-127441.stderr
+++ b/tests/ui/trait-bounds/bad-suggestionf-for-repeated-unsized-bound-127441.stderr
@@ -35,10 +35,10 @@ LL | fn foo8(_: impl ?Sized + Debug + ?Sized ) {}
    |                 ^^^^^^           ^^^^^^
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:9:20
+  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:9:23
    |
 LL | fn foo1<T: ?Sized>(a: T) {}
-   |         -          ^ doesn't have a size known at compile-time
+   |         -             ^ doesn't have a size known at compile-time
    |         |
    |         this type parameter needs to be `Sized`
    |
@@ -54,10 +54,10 @@ LL | fn foo1<T: ?Sized>(a: &T) {}
    |                       +
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:12:29
+  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:12:32
    |
 LL | fn foo2<T: ?Sized + ?Sized>(a: T) {}
-   |         -                   ^ doesn't have a size known at compile-time
+   |         -                      ^ doesn't have a size known at compile-time
    |         |
    |         this type parameter needs to be `Sized`
    |
@@ -73,10 +73,10 @@ LL | fn foo2<T: ?Sized + ?Sized>(a: &T) {}
    |                                +
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:16:37
+  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:16:40
    |
 LL | fn foo3<T: ?Sized + ?Sized + Debug>(a: T) {}
-   |         -                           ^ doesn't have a size known at compile-time
+   |         -                              ^ doesn't have a size known at compile-time
    |         |
    |         this type parameter needs to be `Sized`
    |
@@ -92,10 +92,10 @@ LL | fn foo3<T: ?Sized + ?Sized + Debug>(a: &T) {}
    |                                        +
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:20:38
+  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:20:41
    |
 LL | fn foo4<T: ?Sized + Debug + ?Sized >(a: T) {}
-   |         -                            ^ doesn't have a size known at compile-time
+   |         -                               ^ doesn't have a size known at compile-time
    |         |
    |         this type parameter needs to be `Sized`
    |
@@ -111,12 +111,13 @@ LL | fn foo4<T: ?Sized + Debug + ?Sized >(a: &T) {}
    |                                         +
 
 error[E0277]: the size for values of type `impl ?Sized` cannot be known at compilation time
-  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:24:9
+  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:24:12
    |
 LL | fn foo5(_: impl ?Sized) {}
-   |         ^  ----------- this type parameter needs to be `Sized`
-   |         |
-   |         doesn't have a size known at compile-time
+   |            ^^^^^^^^^^^
+   |            |
+   |            doesn't have a size known at compile-time
+   |            this type parameter needs to be `Sized`
    |
    = help: unsized fn params are gated as an unstable feature
 help: consider replacing `?Sized` with `Sized`
@@ -130,12 +131,13 @@ LL | fn foo5(_: &impl ?Sized) {}
    |            +
 
 error[E0277]: the size for values of type `impl ?Sized + ?Sized` cannot be known at compilation time
-  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:27:9
+  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:27:12
    |
 LL | fn foo6(_: impl ?Sized + ?Sized) {}
-   |         ^  -------------------- this type parameter needs to be `Sized`
-   |         |
-   |         doesn't have a size known at compile-time
+   |            ^^^^^^^^^^^^^^^^^^^^
+   |            |
+   |            doesn't have a size known at compile-time
+   |            this type parameter needs to be `Sized`
    |
    = help: unsized fn params are gated as an unstable feature
 help: consider restricting type parameters
@@ -149,12 +151,13 @@ LL | fn foo6(_: &impl ?Sized + ?Sized) {}
    |            +
 
 error[E0277]: the size for values of type `impl ?Sized + ?Sized + Debug` cannot be known at compilation time
-  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:31:9
+  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:31:12
    |
 LL | fn foo7(_: impl ?Sized + ?Sized + Debug) {}
-   |         ^  ---------------------------- this type parameter needs to be `Sized`
-   |         |
-   |         doesn't have a size known at compile-time
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            |
+   |            doesn't have a size known at compile-time
+   |            this type parameter needs to be `Sized`
    |
    = help: unsized fn params are gated as an unstable feature
 help: consider restricting type parameters
@@ -168,12 +171,13 @@ LL | fn foo7(_: &impl ?Sized + ?Sized + Debug) {}
    |            +
 
 error[E0277]: the size for values of type `impl ?Sized + Debug + ?Sized` cannot be known at compilation time
-  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:35:9
+  --> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:35:12
    |
 LL | fn foo8(_: impl ?Sized + Debug + ?Sized ) {}
-   |         ^  ---------------------------- this type parameter needs to be `Sized`
-   |         |
-   |         doesn't have a size known at compile-time
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            |
+   |            doesn't have a size known at compile-time
+   |            this type parameter needs to be `Sized`
    |
    = help: unsized fn params are gated as an unstable feature
 help: consider restricting type parameters
diff --git a/tests/ui/traits/alias/dont-elaborate-non-self.stderr b/tests/ui/traits/alias/dont-elaborate-non-self.stderr
index 4e2edb474c0..952f78dd3da 100644
--- a/tests/ui/traits/alias/dont-elaborate-non-self.stderr
+++ b/tests/ui/traits/alias/dont-elaborate-non-self.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `(dyn Fn() -> Fut + 'static)` cannot be known at compilation time
-  --> $DIR/dont-elaborate-non-self.rs:7:11
+  --> $DIR/dont-elaborate-non-self.rs:7:14
    |
 LL | fn f<Fut>(a: dyn F<Fut>) {}
-   |           ^ doesn't have a size known at compile-time
+   |              ^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Fn() -> Fut + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/traits/bound/not-on-bare-trait-2021.stderr b/tests/ui/traits/bound/not-on-bare-trait-2021.stderr
index 57d3bc8f109..e05ae8e5267 100644
--- a/tests/ui/traits/bound/not-on-bare-trait-2021.stderr
+++ b/tests/ui/traits/bound/not-on-bare-trait-2021.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time
-  --> $DIR/not-on-bare-trait-2021.rs:8:8
+  --> $DIR/not-on-bare-trait-2021.rs:8:12
    |
 LL | fn foo(_x: Foo + Send) {
-   |        ^^ doesn't have a size known at compile-time
+   |            ^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Foo + Send + 'static)`
    = help: unsized fn params are gated as an unstable feature
@@ -16,10 +16,10 @@ LL | fn foo(_x: &(dyn Foo + Send)) {
    |            +++++           +
 
 error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
-  --> $DIR/not-on-bare-trait-2021.rs:12:8
+  --> $DIR/not-on-bare-trait-2021.rs:12:11
    |
 LL | fn bar(x: Foo) -> Foo {
-   |        ^ doesn't have a size known at compile-time
+   |           ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/traits/bound/not-on-bare-trait.stderr b/tests/ui/traits/bound/not-on-bare-trait.stderr
index f1e7a28654a..3c9b1413d64 100644
--- a/tests/ui/traits/bound/not-on-bare-trait.stderr
+++ b/tests/ui/traits/bound/not-on-bare-trait.stderr
@@ -13,10 +13,10 @@ LL | fn foo(_x: dyn Foo + Send) {
    |            +++
 
 error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time
-  --> $DIR/not-on-bare-trait.rs:7:8
+  --> $DIR/not-on-bare-trait.rs:7:12
    |
 LL | fn foo(_x: Foo + Send) {
-   |        ^^ doesn't have a size known at compile-time
+   |            ^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Foo + Send + 'static)`
    = help: unsized fn params are gated as an unstable feature
@@ -30,10 +30,10 @@ LL | fn foo(_x: &(dyn Foo + Send)) {
    |            +++++           +
 
 error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time
-  --> $DIR/not-on-bare-trait.rs:12:8
+  --> $DIR/not-on-bare-trait.rs:12:12
    |
 LL | fn bar(_x: (dyn Foo + Send)) {
-   |        ^^ doesn't have a size known at compile-time
+   |            ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Foo + Send + 'static)`
    = help: unsized fn params are gated as an unstable feature
diff --git a/tests/ui/traits/issue-99875.rs b/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs
index cf73fd8d31f..cf73fd8d31f 100644
--- a/tests/ui/traits/issue-99875.rs
+++ b/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.rs
diff --git a/tests/ui/traits/issue-99875.stderr b/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr
index 29e87571561..0666da4c707 100644
--- a/tests/ui/traits/issue-99875.stderr
+++ b/tests/ui/traits/fn-pointer/bare-fn-no-impl-fn-ptr-99875.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the trait bound `fn(Argument) -> Return {function}: Trait` is not satisfied
-  --> $DIR/issue-99875.rs:12:11
+  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:12:11
    |
 LL |     takes(function);
    |     ----- ^^^^^^^^ the trait `Trait` is not implemented for fn item `fn(Argument) -> Return {function}`
@@ -7,7 +7,7 @@ LL |     takes(function);
    |     required by a bound introduced by this call
    |
 note: required by a bound in `takes`
-  --> $DIR/issue-99875.rs:9:18
+  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:9:18
    |
 LL | fn takes(_: impl Trait) {}
    |                  ^^^^^ required by this bound in `takes`
@@ -16,17 +16,17 @@ help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`,
 LL |     takes(function as fn(Argument) -> Return);
    |                    +++++++++++++++++++++++++
 
-error[E0277]: the trait bound `{closure@$DIR/issue-99875.rs:14:11: 14:34}: Trait` is not satisfied
-  --> $DIR/issue-99875.rs:14:11
+error[E0277]: the trait bound `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11: 14:34}: Trait` is not satisfied
+  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11
    |
 LL |     takes(|_: Argument| -> Return { todo!() });
-   |     ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for closure `{closure@$DIR/issue-99875.rs:14:11: 14:34}`
+   |     ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for closure `{closure@$DIR/bare-fn-no-impl-fn-ptr-99875.rs:14:11: 14:34}`
    |     |
    |     required by a bound introduced by this call
    |
    = help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`
 note: required by a bound in `takes`
-  --> $DIR/issue-99875.rs:9:18
+  --> $DIR/bare-fn-no-impl-fn-ptr-99875.rs:9:18
    |
 LL | fn takes(_: impl Trait) {}
    |                  ^^^^^ required by this bound in `takes`
diff --git a/tests/ui/traits/fn-trait-cast-diagnostic.rs b/tests/ui/traits/fn-pointer/fn-trait-cast-diagnostic.rs
index e20aa210e58..e20aa210e58 100644
--- a/tests/ui/traits/fn-trait-cast-diagnostic.rs
+++ b/tests/ui/traits/fn-pointer/fn-trait-cast-diagnostic.rs
diff --git a/tests/ui/traits/fn-trait-cast-diagnostic.stderr b/tests/ui/traits/fn-pointer/fn-trait-cast-diagnostic.stderr
index 6851dcdd504..6851dcdd504 100644
--- a/tests/ui/traits/fn-trait-cast-diagnostic.stderr
+++ b/tests/ui/traits/fn-pointer/fn-trait-cast-diagnostic.stderr
diff --git a/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.fixed b/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.fixed
new file mode 100644
index 00000000000..e54963d01e8
--- /dev/null
+++ b/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.fixed
@@ -0,0 +1,15 @@
+//@ run-rustfix
+
+trait Foo {}
+
+impl Foo for fn() {}
+
+trait Bar {
+    fn do_stuff(&self) where Self: Foo {}
+}
+impl<T> Bar for T {}
+
+fn main() {
+    (main as fn()).do_stuff();
+    //~^ ERROR the trait bound
+}
diff --git a/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.rs b/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.rs
new file mode 100644
index 00000000000..89c1295613c
--- /dev/null
+++ b/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.rs
@@ -0,0 +1,15 @@
+//@ run-rustfix
+
+trait Foo {}
+
+impl Foo for fn() {}
+
+trait Bar {
+    fn do_stuff(&self) where Self: Foo {}
+}
+impl<T> Bar for T {}
+
+fn main() {
+    main.do_stuff();
+    //~^ ERROR the trait bound
+}
diff --git a/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.stderr b/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.stderr
new file mode 100644
index 00000000000..2fc1523a193
--- /dev/null
+++ b/tests/ui/traits/fn-pointer/suggest-wrap-parens-method.stderr
@@ -0,0 +1,19 @@
+error[E0277]: the trait bound `fn() {main}: Foo` is not satisfied
+  --> $DIR/suggest-wrap-parens-method.rs:13:10
+   |
+LL |     main.do_stuff();
+   |          ^^^^^^^^ the trait `Foo` is not implemented for fn item `fn() {main}`
+   |
+note: required by a bound in `Bar::do_stuff`
+  --> $DIR/suggest-wrap-parens-method.rs:8:36
+   |
+LL |     fn do_stuff(&self) where Self: Foo {}
+   |                                    ^^^ required by this bound in `Bar::do_stuff`
+help: the trait `Foo` is implemented for fn pointer `fn()`, try casting using `as`
+   |
+LL |     (main as fn()).do_stuff();
+   |     +     ++++++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/fn-pointer/suggest-wrap-parens.fixed b/tests/ui/traits/fn-pointer/suggest-wrap-parens.fixed
new file mode 100644
index 00000000000..0bc8792b04e
--- /dev/null
+++ b/tests/ui/traits/fn-pointer/suggest-wrap-parens.fixed
@@ -0,0 +1,10 @@
+//@ run-rustfix
+
+trait Foo {}
+
+impl Foo for fn() {}
+
+fn main() {
+    let _x: &dyn Foo = &(main as fn());
+    //~^ ERROR the trait bound
+}
diff --git a/tests/ui/traits/fn-pointer/suggest-wrap-parens.rs b/tests/ui/traits/fn-pointer/suggest-wrap-parens.rs
new file mode 100644
index 00000000000..ffe0826c035
--- /dev/null
+++ b/tests/ui/traits/fn-pointer/suggest-wrap-parens.rs
@@ -0,0 +1,10 @@
+//@ run-rustfix
+
+trait Foo {}
+
+impl Foo for fn() {}
+
+fn main() {
+    let _x: &dyn Foo = &main;
+    //~^ ERROR the trait bound
+}
diff --git a/tests/ui/traits/fn-pointer/suggest-wrap-parens.stderr b/tests/ui/traits/fn-pointer/suggest-wrap-parens.stderr
new file mode 100644
index 00000000000..b71debac715
--- /dev/null
+++ b/tests/ui/traits/fn-pointer/suggest-wrap-parens.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `fn() {main}: Foo` is not satisfied
+  --> $DIR/suggest-wrap-parens.rs:8:24
+   |
+LL |     let _x: &dyn Foo = &main;
+   |                        ^^^^^ the trait `Foo` is not implemented for fn item `fn() {main}`
+   |
+   = note: required for the cast from `&fn() {main}` to `&dyn Foo`
+help: the trait `Foo` is implemented for fn pointer `fn()`, try casting using `as`
+   |
+LL |     let _x: &dyn Foo = &(main as fn());
+   |                         +     ++++++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/type/type-check/unknown_type_for_closure.stderr b/tests/ui/type/type-check/unknown_type_for_closure.stderr
index 960c0eff8ea..387ba4db9d3 100644
--- a/tests/ui/type/type-check/unknown_type_for_closure.stderr
+++ b/tests/ui/type/type-check/unknown_type_for_closure.stderr
@@ -16,10 +16,10 @@ LL |     let x = |_: /* Type */| {};
    |               ++++++++++++
 
 error[E0282]: type annotations needed
-  --> $DIR/unknown_type_for_closure.rs:10:14
+  --> $DIR/unknown_type_for_closure.rs:10:17
    |
 LL |     let x = |k: _| {};
-   |              ^ cannot infer type
+   |                 ^ cannot infer type
 
 error[E0282]: type annotations needed
   --> $DIR/unknown_type_for_closure.rs:14:28
diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr
index 9d295f88da5..2c064fbb19f 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item.stderr
+++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr
@@ -358,10 +358,10 @@ LL ~         b: (T, T),
    |
 
 error[E0282]: type annotations needed
-  --> $DIR/typeck_type_placeholder_item.rs:128:18
+  --> $DIR/typeck_type_placeholder_item.rs:128:21
    |
 LL |     fn fn_test11(_: _) -> (_, _) { panic!() }
-   |                  ^ cannot infer type
+   |                     ^ cannot infer type
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/typeck_type_placeholder_item.rs:128:28
diff --git a/tests/ui/unsized/unsized-fn-arg.stderr b/tests/ui/unsized/unsized-fn-arg.stderr
index c8a6622b809..3c582e8d93a 100644
--- a/tests/ui/unsized/unsized-fn-arg.stderr
+++ b/tests/ui/unsized/unsized-fn-arg.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-  --> $DIR/unsized-fn-arg.rs:5:17
+  --> $DIR/unsized-fn-arg.rs:5:20
    |
 LL | fn f<T: ?Sized>(t: T) {}
-   |      -          ^ doesn't have a size known at compile-time
+   |      -             ^ doesn't have a size known at compile-time
    |      |
    |      this type parameter needs to be `Sized`
    |
diff --git a/tests/ui/unsized/unsized6.stderr b/tests/ui/unsized/unsized6.stderr
index d406120efc5..de921709865 100644
--- a/tests/ui/unsized/unsized6.stderr
+++ b/tests/ui/unsized/unsized6.stderr
@@ -206,10 +206,10 @@ LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
    |
 
 error[E0277]: the size for values of type `X` cannot be known at compilation time
-  --> $DIR/unsized6.rs:38:18
+  --> $DIR/unsized6.rs:38:21
    |
 LL | fn g1<X: ?Sized>(x: X) {}
-   |       -          ^ doesn't have a size known at compile-time
+   |       -             ^ doesn't have a size known at compile-time
    |       |
    |       this type parameter needs to be `Sized`
    |
@@ -225,10 +225,10 @@ LL | fn g1<X: ?Sized>(x: &X) {}
    |                     +
 
 error[E0277]: the size for values of type `X` cannot be known at compilation time
-  --> $DIR/unsized6.rs:40:22
+  --> $DIR/unsized6.rs:40:25
    |
 LL | fn g2<X: ?Sized + T>(x: X) {}
-   |       -              ^ doesn't have a size known at compile-time
+   |       -                 ^ doesn't have a size known at compile-time
    |       |
    |       this type parameter needs to be `Sized`
    |