File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -504,7 +504,7 @@ impl<'a> StringReader<'a> {
504504 self . bump ( ) ;
505505
506506 // line comments starting with "///" or "//!" are doc-comments
507- let doc_comment = self . ch_is ( '/' ) || self . ch_is ( '!' ) ;
507+ let doc_comment = ( self . ch_is ( '/' ) && ! self . nextch_is ( '/' ) ) || self . ch_is ( '!' ) ;
508508 let start_bpos = self . pos - BytePos ( 2 ) ;
509509
510510 while !self . is_eof ( ) {
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ pub fn bar() {}
2121//~^^ ERROR: bare CR not allowed in block doc-comment
2222
2323fn main ( ) {
24+ //! doc comment with bare CR: ' '
25+ //~^ ERROR: bare CR not allowed in doc-comment
26+
27+ /*! block doc comment with bare CR: ' ' */
28+ //~^ ERROR: bare CR not allowed in block doc-comment
29+
2430 // the following string literal has a bare CR in it
2531 let _s = "foo bar" ; //~ ERROR: bare CR not allowed in string
2632
Original file line number Diff line number Diff line change 1+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ // ignore-tidy-cr
12+
13+ // nondoc comment with bare CR: ' '
14+ //// nondoc comment with bare CR: ' '
15+ /* block nondoc comment with bare CR: ' ' */
16+
17+ fn main ( ) {
18+ }
You can’t perform that action at this time.
0 commit comments