We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a76244f commit aef0581Copy full SHA for aef0581
src/libsyntax/parse/lexer/mod.rs
@@ -406,7 +406,7 @@ impl<'a> StringReader<'a> {
406
407
// line comments starting with "///" or "//!" are doc-comments
408
let doc_comment = self.curr_is('/') || self.curr_is('!');
409
- let start_bpos = self.pos - BytePos(3);
+ let start_bpos = self.last_pos - BytePos(2);
410
411
while !self.is_eof() {
412
match self.curr.unwrap() {
@@ -415,9 +415,9 @@ impl<'a> StringReader<'a> {
415
if self.nextch_is('\n') {
416
// CRLF
417
break
418
- } else {
+ } else if doc_comment {
419
self.err_span_(self.last_pos, self.pos,
420
- "bare CR not allowed in comment");
+ "bare CR not allowed in doc-comment");
421
}
422
423
_ => ()
0 commit comments