File tree 3 files changed +12
-5
lines changed
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> {
5422
5422
token:: CloseDelim ( token:: Brace ) => { }
5423
5423
token:: DocComment ( _) => {
5424
5424
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 ) {
5428
5427
err. emit ( ) ;
5429
5428
} else {
5430
5429
return Err ( err) ;
Original file line number Diff line number Diff line change 9
9
// except according to those terms.
10
10
11
11
// compile-flags: -Z continue-parse-after-error
12
+
12
13
struct X {
13
14
a : u8 /** document a */ ,
14
15
//~^ ERROR found a documentation comment that doesn't document anything
15
16
//~| HELP maybe a comment was intended
16
17
}
17
18
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
+
18
25
fn main ( ) {
19
- let y = X { a : 1 } ;
26
+ let x = X { a : 1 } ;
27
+ let y = Y { a : 1 } ;
20
28
}
Original file line number Diff line number Diff line change 11
11
macro_rules! failed {
12
12
( ) => { {
13
13
let x = 5 "" ; //~ ERROR found `""`
14
- } } //~ ERROR macro expansion ignores token `}`
14
+ } }
15
15
}
16
16
17
17
fn main ( ) {
You can’t perform that action at this time.
0 commit comments