diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-12-28 17:08:45 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-12-28 17:09:22 +0100 |
| commit | ee97600a6f89963b08e1a16a36466a3d9b4783ba (patch) | |
| tree | d79d7a87dec3dc3dc5b25fa1a80dec38af1a32ad /compiler | |
| parent | 60f3bd78eeac87ad474916d36d29ed7e5084b25b (diff) | |
| download | rust-ee97600a6f89963b08e1a16a36466a3d9b4783ba.tar.gz rust-ee97600a6f89963b08e1a16a36466a3d9b4783ba.zip | |
Fix invalid removal of backlines from doc comments
Diffstat (limited to 'compiler')
| -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 } } |
