File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -5422,9 +5422,8 @@ impl<'a> Parser<'a> {
54225422 token:: CloseDelim ( token:: Brace ) => { }
54235423 token:: DocComment ( _) => {
54245424 let mut err = self . span_fatal_err ( self . span , Error :: UselessDocComment ) ;
5425- if self . eat ( & token:: Comma ) ||
5426- self . look_ahead ( 1 , |t| * t == token:: CloseDelim ( token:: Brace ) )
5427- {
5425+ self . bump ( ) ; // consume the doc comment
5426+ if self . eat ( & token:: Comma ) || self . token == token:: CloseDelim ( token:: Brace ) {
54285427 err. emit ( ) ;
54295428 } else {
54305429 return Err ( err) ;
Original file line number Diff line number Diff line change 99// except according to those terms.
1010
1111// compile-flags: -Z continue-parse-after-error
12+
1213struct X {
1314 a : u8 /** document a */ ,
1415 //~^ ERROR found a documentation comment that doesn't document anything
1516 //~| HELP maybe a comment was intended
1617}
1718
19+ struct Y {
20+ a : u8 /// document a
21+ //~^ ERROR found a documentation comment that doesn't document anything
22+ //~| HELP maybe a comment was intended
23+ }
24+
1825fn main ( ) {
19- let y = X { a : 1 } ;
26+ let x = X { a : 1 } ;
27+ let y = Y { a : 1 } ;
2028}
Original file line number Diff line number Diff line change 1111macro_rules! failed {
1212 ( ) => { {
1313 let x = 5 "" ; //~ ERROR found `""`
14- } } //~ ERROR macro expansion ignores token `}`
14+ } }
1515}
1616
1717fn main ( ) {
You can’t perform that action at this time.
0 commit comments