diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-01-10 11:03:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-10 11:03:05 +0100 |
| commit | d20affbf8d80f03e2390fd75690a5de5e883f85a (patch) | |
| tree | 9a047ff4a7ec362e99334ddc4e74d0936eb78f9f /compiler/rustc_ast/src | |
| parent | 6466f89fc5df36b4c841fca9d10e27c50dd744b5 (diff) | |
| parent | c6ee7bbe5197dbdec59acaab9b479f0610dfa5e1 (diff) | |
| download | rust-d20affbf8d80f03e2390fd75690a5de5e883f85a.tar.gz rust-d20affbf8d80f03e2390fd75690a5de5e883f85a.zip | |
Rollup merge of #92357 - GuillaumeGomez:fix-doc-comment-backline-removal, r=camelid
Fix invalid removal of newlines from doc comments Fixes https://github.com/rust-lang/rust/issues/91201. Before:  After:  r? `@camelid`
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/util/comments.rs | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/compiler/rustc_ast/src/util/comments.rs b/compiler/rustc_ast/src/util/comments.rs index 80a06fa5943..0a391123dd3 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 } } |
