1
Fork 0

Rollup merge of #95613 - GuillaumeGomez:fix-rustdoc-attr-display, r=notriddle

Fix rustdoc attribute display

Fixes #81482.

r? `@notriddle`
This commit is contained in:
Dylan DPC 2022-04-03 23:21:43 +02:00 committed by GitHub
commit 5925c8ee79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -1002,7 +1002,12 @@ fn attributes(it: &clean::Item) -> Vec<String> {
.iter()
.filter_map(|attr| {
if ALLOWED_ATTRIBUTES.contains(&attr.name_or_empty()) {
Some(pprust::attribute_to_string(attr).replace('\n', "").replace(" ", " "))
Some(
pprust::attribute_to_string(attr)
.replace("\\\n", "")
.replace('\n', "")
.replace(" ", " "),
)
} else {
None
}