Skip to content

fix the doc-comment-decoration-trimming edge-case rustdoc ICE #47210

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libsyntax/parse/lexer/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> String {
break;
}
}
if i > line.len() {
if i >= line.len() {
can_trim = false;
}
if !can_trim {
Expand Down
18 changes: 18 additions & 0 deletions src/test/rustdoc/issue-47197-blank-line-in-doc-block.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// @has issue_47197_blank_line_in_doc_block/fn.whose_woods_these_are_i_think_i_know.html

/**
* snow

* ice
*/
pub fn whose_woods_these_are_i_think_i_know() {}