File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ impl<'a> StringReader<'a> {
226226 loop {
227227 idx = match string[ idx..] . find ( '\r' ) {
228228 None => break ,
229- Some ( it) => it + 1
229+ Some ( it) => idx + it + 1
230230 } ;
231231 if string[ idx..] . chars ( ) . next ( ) != Some ( '\n' ) {
232232 self . err_span_ ( start + BytePos ( idx as u32 - 1 ) ,
Original file line number Diff line number Diff line change 1+ // Issue #62863
2+ // ignore-tidy-cr
3+
4+ // Note: if you see ^M in this file, that's how your editor renders literal `\r`
5+
6+ /// This do c comment contains three isolated `\r` symbols
7+ //~^ ERROR bare CR not allowed in doc-comment
8+ //~| ERROR bare CR not allowed in doc-comment
9+ //~| ERROR bare CR not allowed in doc-comment
10+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: bare CR not allowed in doc-comment
2+ --> $DIR/several-carriage-returns-in-doc-comment.rs:6:12
3+ |
4+ LL | /// This doc comment contains three isolated `\r` symbols
5+ | ^
6+
7+ error: bare CR not allowed in doc-comment
8+ --> $DIR/several-carriage-returns-in-doc-comment.rs:6:32
9+ |
10+ LL | /// This doc comment contains three isolated `\r` symbols
11+ | ^
12+
13+ error: bare CR not allowed in doc-comment
14+ --> $DIR/several-carriage-returns-in-doc-comment.rs:6:52
15+ |
16+ LL | /// This doc comment contains three isolated `\r` symbols
17+ | ^
18+
19+ error: aborting due to 3 previous errors
20+
You can’t perform that action at this time.
0 commit comments