File tree 2 files changed +5
-2
lines changed
compiler/rustc_errors/src
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ impl StyledBuffer {
93
93
if start == end {
94
94
return ;
95
95
}
96
+ if start > self . lines [ line] . len ( ) || end > self . lines [ line] . len ( ) {
97
+ return ;
98
+ }
96
99
let _ = self . lines [ line] . drain ( start..( end - string. chars ( ) . count ( ) ) ) ;
97
100
for ( i, c) in string. chars ( ) . enumerate ( ) {
98
101
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
8
8
note: the lint level is defined here
9
9
--> $DIR/diagnostic-width.rs:2:9
10
10
|
11
- LL | ...ny(rustdoc::bare_url ...
12
- | ^^^^^^^^^^ ^^^^^^^^
11
+ LL | ...ny(ru ...are_urls)]
12
+ | ^^... ^^^^^^^^
13
13
help: use an automatic link instead
14
14
|
15
15
LL | /// This is a long line that contains a <http://link.com>
You can’t perform that action at this time.
0 commit comments