rust/src/libsyntax/parse
Zack M. Davis 3cfea33432 wherein careful doc-decoration arithmetic proves quite the ICE-breaker
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 #47197.
2018-01-06 11:17:29 -08:00
..
lexer wherein careful doc-decoration arithmetic proves quite the ICE-breaker 2018-01-06 11:17:29 -08:00
attr.rs edit and fix bad spacing of inner-attribute-not-allowed note 2017-10-30 17:11:33 -07:00
classify.rs Catch expression does not require semicolon to be a statement 2017-07-18 03:42:21 +03:00
common.rs Fix some clippy warnings in libsyntax 2017-05-12 20:05:39 +02:00
mod.rs Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkov 2017-12-22 07:22:33 +00:00
obsolete.rs address review comments 2017-11-20 18:03:20 +00:00
parser.rs Auto merge of #46895 - ricochet1k:macro-lifetimes, r=jseyfried 2018-01-01 07:21:23 +00:00
token.rs refactor lifetime out of is_lifetime 2017-12-30 21:47:45 -05:00