diff options
| author | Alona Enraght-Moony <code@alona.page> | 2025-05-07 18:45:58 +0000 |
|---|---|---|
| committer | Alona Enraght-Moony <code@alona.page> | 2025-05-07 18:45:58 +0000 |
| commit | aeb70c710abd019fabafb85536a4fcabfbef0d5d (patch) | |
| tree | 28d71207352fc67f62d75e9d7deec0eff161f6f3 /src | |
| parent | 1a95cc6f9d950992ba27746e45caf40118581cb1 (diff) | |
| download | rust-aeb70c710abd019fabafb85536a4fcabfbef0d5d.tar.gz rust-aeb70c710abd019fabafb85536a4fcabfbef0d5d.zip | |
rustdoc-json: Remove newlines from attributes
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/types.rs | 6 |
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( |
