-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rustdoc ICE when stripping doc comment decorations #47197
Comments
QuietMisdreavus
added
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
labels
Jan 4, 2018
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Jan 6, 2018
This `horizontal_trim` function strips the leading whitespace from doc-comments that have a left-asterisk-margin: /** * You know what I mean— * * comments like this! */ The index of the column of asterisks is `i`, and if trimming is deemed possible, we slice each line from `i+1` to the end of the line. But if, in particular, `i` was 0 _and_ there was an empty line (as in the example given in the reporting issue), we ended up panicking trying to slice an empty string from 0+1 (== 1). Let's tighten our check to say that we can't trim when `i` is even the same as the length of the line, not just when it's greater. (Any such cases would panic trying to slice `line` from `line.len()+1`.) Resolves rust-lang#47197.
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Jan 8, 2018
…blems_in_computer_science, r=QuietMisdreavus fix the doc-comment-decoration-trimming edge-case rustdoc ICE This `horizontal_trim` function strips the leading whitespace from doc-comments that have a left-asterisk-margin: ``` /** * You know what I mean— * * comments like this! */ ``` The index of the column of asterisks is `i`, and if trimming is deemed possible, we slice each line from `i+1` to the end of the line. But if, in particular, `i` was 0 _and_ there was an empty line (as in the example given in the reporting issue), we ended up panicking trying to slice an empty string from 0+1 (== 1). Let's tighten our check to say that we can't trim when `i` is even the same as the length of the line, not just when it's greater. (Any such cases would panic trying to slice `line` from `line.len()+1`.) Resolves rust-lang#47197.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running
rustdoc
on this causes an ICE.The text was updated successfully, but these errors were encountered: