about summary refs log tree commit diff
path: root/src/librustdoc/html/format.rs
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2025-02-01 14:54:02 -0800
committerDavid Tolnay <dtolnay@gmail.com>2025-02-01 15:04:19 -0800
commitb866debf3cdbc30f71b0800684236213ebbb2d8c (patch)
treefabb1a5f4726fc6e6623972972a89272633a58b0 /src/librustdoc/html/format.rs
parent5f447a1ca6516fefe33fa0351aaf2c27b2911d98 (diff)
downloadrust-b866debf3cdbc30f71b0800684236213ebbb2d8c.tar.gz
rust-b866debf3cdbc30f71b0800684236213ebbb2d8c.zip
Omit argument names from function pointers that do not have argument names
Diffstat (limited to 'src/librustdoc/html/format.rs')
-rw-r--r--src/librustdoc/html/format.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 20a8dc72491..ffd457c8273 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -1408,7 +1408,9 @@ impl clean::Arguments {
     ) -> impl Display + 'a + Captures<'tcx> {
         fmt::from_fn(move |f| {
             for (i, input) in self.values.iter().enumerate() {
-                write!(f, "{}: ", input.name)?;
+                if !input.name.is_empty() {
+                    write!(f, "{}: ", input.name)?;
+                }
                 input.type_.print(cx).fmt(f)?;
                 if i + 1 < self.values.len() {
                     write!(f, ", ")?;