about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-05-08 08:14:19 +0200
committerGitHub <noreply@github.com>2025-05-08 08:14:19 +0200
commitcd235bdec8e07f94acc57f70cb33747956ca4eb6 (patch)
tree00632e0cca99a2a8319811844361e7a0b27455e1 /src/librustdoc
parent74b79aee60a5fba5fbe773ec45e205b46622ee37 (diff)
parentaeb70c710abd019fabafb85536a4fcabfbef0d5d (diff)
downloadrust-cd235bdec8e07f94acc57f70cb33747956ca4eb6.tar.gz
rust-cd235bdec8e07f94acc57f70cb33747956ca4eb6.zip
Rollup merge of #140762 - aDotInTheVoid:popnl, r=GuillaumeGomez
rustdoc-json: Remove newlines from attributes

Fixes #140689

Not sure if this needs to bump `FORMAT_VERSION` or not.

r? ``@GuillaumeGomez``

cc ``@obi1kenobi``
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/clean/types.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index bbe11bf56af..15890fff0c3 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -786,7 +786,11 @@ impl Item {
                             // because it isn't public API.
                             None
                         }
-                        _ => Some(rustc_hir_pretty::attribute_to_string(&tcx, attr)),
+                        _ => Some({
+                            let mut s = rustc_hir_pretty::attribute_to_string(&tcx, attr);
+                            assert_eq!(s.pop(), Some('\n'));
+                            s
+                        }),
                     }
                 } else if attr.has_any_name(ALLOWED_ATTRIBUTES) {
                     Some(