File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -3749,6 +3749,16 @@ impl<'a> Parser<'a> {
3749
3749
t. is_keyword ( keywords:: Pub ) )
3750
3750
}
3751
3751
3752
+ fn eat_defaultness ( & mut self ) -> bool {
3753
+ let is_defaultness = self . is_defaultness ( ) ;
3754
+ if is_defaultness {
3755
+ self . bump ( )
3756
+ } else {
3757
+ self . expected_tokens . push ( TokenType :: Keyword ( keywords:: Default ) ) ;
3758
+ }
3759
+ is_defaultness
3760
+ }
3761
+
3752
3762
fn eat_macro_def ( & mut self , attrs : & [ Attribute ] , vis : & Visibility )
3753
3763
-> PResult < ' a , Option < P < Item > > > {
3754
3764
let lo = self . span ;
@@ -5223,8 +5233,7 @@ impl<'a> Parser<'a> {
5223
5233
5224
5234
/// Parse defaultness: DEFAULT or nothing
5225
5235
fn parse_defaultness ( & mut self ) -> PResult < ' a , Defaultness > {
5226
- if self . is_defaultness ( ) {
5227
- self . bump ( ) ;
5236
+ if self . eat_defaultness ( ) {
5228
5237
Ok ( Defaultness :: Default )
5229
5238
} else {
5230
5239
Ok ( Defaultness :: Final )
You can’t perform that action at this time.
0 commit comments