diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-11-06 19:41:33 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-11-06 20:21:29 +0100 |
| commit | e8f1d57d8021d51c5b5d5eb17791c680ca770791 (patch) | |
| tree | d3157e753597ea8059f3d95fceeeb8b39b10f045 | |
| parent | d22dd65835190278f315e06442614142653ec98f (diff) | |
| download | rust-e8f1d57d8021d51c5b5d5eb17791c680ca770791.tar.gz rust-e8f1d57d8021d51c5b5d5eb17791c680ca770791.zip | |
Fix last doc code comment being removed if it only had one character
| -rw-r--r-- | compiler/rustc_ast/src/util/comments.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ast/src/util/comments.rs b/compiler/rustc_ast/src/util/comments.rs index 542a330a031..c40aec4b671 100644 --- a/compiler/rustc_ast/src/util/comments.rs +++ b/compiler/rustc_ast/src/util/comments.rs @@ -38,7 +38,7 @@ pub fn beautify_doc_string(data: Symbol) -> Symbol { i += 1; } // like the first, a last line of all stars should be omitted - if j > i && lines[j - 1].chars().skip(1).all(|c| c == '*') { + if j > i && !lines[j - 1].is_empty() && lines[j - 1].chars().all(|c| c == '*') { j -= 1; } |
