about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMasaki Hara <ackie.h.gmai@gmail.com>2017-05-08 22:29:24 +0900
committerMasaki Hara <ackie.h.gmai@gmail.com>2017-05-08 22:29:24 +0900
commit0e8e45c74068b72301f9045f0efc38ba8b51e0a4 (patch)
treec72cf8c4e85fdb1647c318d7cba3896dfc2da09f /src/libsyntax/parse
parent70198a0a44633c7c9d14fce2159c1f750491287b (diff)
downloadrust-0e8e45c74068b72301f9045f0efc38ba8b51e0a4.tar.gz
rust-0e8e45c74068b72301f9045f0efc38ba8b51e0a4.zip
Allow bare CR in ////-style comment.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 7d2a1b3c4a4..ded1f0b599a 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -504,7 +504,7 @@ impl<'a> StringReader<'a> {
                     self.bump();
 
                     // line comments starting with "///" or "//!" are doc-comments
-                    let doc_comment = self.ch_is('/') || self.ch_is('!');
+                    let doc_comment = (self.ch_is('/') && !self.nextch_is('/')) || self.ch_is('!');
                     let start_bpos = self.pos - BytePos(2);
 
                     while !self.is_eof() {