File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 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> {
37493749 t. is_keyword ( keywords:: Pub ) )
37503750 }
37513751
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+
37523762 fn eat_macro_def ( & mut self , attrs : & [ Attribute ] , vis : & Visibility )
37533763 -> PResult < ' a , Option < P < Item > > > {
37543764 let lo = self . span ;
@@ -5223,8 +5233,7 @@ impl<'a> Parser<'a> {
52235233
52245234 /// Parse defaultness: DEFAULT or nothing
52255235 fn parse_defaultness ( & mut self ) -> PResult < ' a , Defaultness > {
5226- if self . is_defaultness ( ) {
5227- self . bump ( ) ;
5236+ if self . eat_defaultness ( ) {
52285237 Ok ( Defaultness :: Default )
52295238 } else {
52305239 Ok ( Defaultness :: Final )
You can’t perform that action at this time.
0 commit comments