diff --git a/compiler/rustc_ast/src/util/comments.rs b/compiler/rustc_ast/src/util/comments.rs index 80a06fa594366..0a391123dd381 100644 --- a/compiler/rustc_ast/src/util/comments.rs +++ b/compiler/rustc_ast/src/util/comments.rs @@ -34,18 +34,11 @@ pub fn beautify_doc_string(data: Symbol) -> Symbol { i += 1; } - while i < j && lines[i].trim().is_empty() { - i += 1; - } // like the first, a last line of all stars should be omitted if j > i && !lines[j - 1].is_empty() && lines[j - 1].chars().all(|c| c == '*') { j -= 1; } - while j > i && lines[j - 1].trim().is_empty() { - j -= 1; - } - if i != 0 || j != lines.len() { Some((i, j)) } else { None } } diff --git a/src/test/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html b/src/test/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html index 69d647a92e82b..8ff114b993edb 100644 --- a/src/test/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html +++ b/src/test/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html @@ -1,4 +1,4 @@ -
Hello world! -Goodbye! +
Hello world!
+Goodbye! Hello again!
Par 1
+Par 2
+