@@ -29,7 +29,7 @@ use super::{
2929/// This struct has its own module, to ensure that the parser code
3030/// cannot directly access the `attrs` field.
3131#[ derive( Debug , Clone ) ]
32- pub struct AttrWrapper {
32+ pub ( super ) struct AttrWrapper {
3333 attrs : AttrVec ,
3434 // The start of the outer attributes in the parser's token stream.
3535 // This lets us create a `NodeReplacement` for the entire attribute
@@ -41,11 +41,11 @@ impl AttrWrapper {
4141 pub ( super ) fn new ( attrs : AttrVec , start_pos : u32 ) -> AttrWrapper {
4242 AttrWrapper { attrs, start_pos }
4343 }
44- pub fn empty ( ) -> AttrWrapper {
44+ pub ( super ) fn empty ( ) -> AttrWrapper {
4545 AttrWrapper { attrs : AttrVec :: new ( ) , start_pos : u32:: MAX }
4646 }
4747
48- pub ( crate ) fn take_for_recovery ( self , psess : & ParseSess ) -> AttrVec {
48+ pub ( super ) fn take_for_recovery ( self , psess : & ParseSess ) -> AttrVec {
4949 psess. dcx ( ) . span_delayed_bug (
5050 self . attrs . get ( 0 ) . map ( |attr| attr. span ) . unwrap_or ( DUMMY_SP ) ,
5151 "AttrVec is taken for recovery but no error is produced" ,
@@ -56,12 +56,12 @@ impl AttrWrapper {
5656
5757 /// Prepend `self.attrs` to `attrs`.
5858 // FIXME: require passing an NT to prevent misuse of this method
59- pub ( crate ) fn prepend_to_nt_inner ( mut self , attrs : & mut AttrVec ) {
59+ pub ( super ) fn prepend_to_nt_inner ( mut self , attrs : & mut AttrVec ) {
6060 mem:: swap ( attrs, & mut self . attrs ) ;
6161 attrs. extend ( self . attrs ) ;
6262 }
6363
64- pub fn is_empty ( & self ) -> bool {
64+ pub ( super ) fn is_empty ( & self ) -> bool {
6565 self . attrs . is_empty ( )
6666 }
6767}
@@ -197,7 +197,7 @@ impl<'a> Parser<'a> {
197197 /// } // 32..33
198198 /// } // 33..34
199199 /// ```
200- pub fn collect_tokens_trailing_token < R : HasAttrs + HasTokens > (
200+ pub ( super ) fn collect_tokens_trailing_token < R : HasAttrs + HasTokens > (
201201 & mut self ,
202202 attrs : AttrWrapper ,
203203 force_collect : ForceCollect ,
0 commit comments