File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
compiler/rustc_errors/src Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ impl StyledBuffer {
9393 if start == end {
9494 return ;
9595 }
96+ if start > self . lines [ line] . len ( ) || end > self . lines [ line] . len ( ) {
97+ return ;
98+ }
9699 let _ = self . lines [ line] . drain ( start..( end - string. chars ( ) . count ( ) ) ) ;
97100 for ( i, c) in string. chars ( ) . enumerate ( ) {
98101 self . lines [ line] [ start + i] = StyledChar :: new ( c, Style :: LineNumber ) ;
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ LL | ... a http://link.com
88note: the lint level is defined here
99 --> $DIR/diagnostic-width.rs:2:9
1010 |
11- LL | ...ny(rustdoc::bare_url ...
12- | ^^^^^^^^^^ ^^^^^^^^
11+ LL | ...ny(ru ...are_urls)]
12+ | ^^... ^^^^^^^^
1313help: use an automatic link instead
1414 |
1515LL | /// This is a long line that contains a <http://link.com>
You can’t perform that action at this time.
0 commit comments