@@ -29,7 +29,7 @@ use super::{
29
29
/// This struct has its own module, to ensure that the parser code
30
30
/// cannot directly access the `attrs` field.
31
31
#[ derive( Debug , Clone ) ]
32
- pub struct AttrWrapper {
32
+ pub ( super ) struct AttrWrapper {
33
33
attrs : AttrVec ,
34
34
// The start of the outer attributes in the parser's token stream.
35
35
// This lets us create a `NodeReplacement` for the entire attribute
@@ -41,11 +41,11 @@ impl AttrWrapper {
41
41
pub ( super ) fn new ( attrs : AttrVec , start_pos : u32 ) -> AttrWrapper {
42
42
AttrWrapper { attrs, start_pos }
43
43
}
44
- pub fn empty ( ) -> AttrWrapper {
44
+ pub ( super ) fn empty ( ) -> AttrWrapper {
45
45
AttrWrapper { attrs : AttrVec :: new ( ) , start_pos : u32:: MAX }
46
46
}
47
47
48
- pub ( crate ) fn take_for_recovery ( self , psess : & ParseSess ) -> AttrVec {
48
+ pub ( super ) fn take_for_recovery ( self , psess : & ParseSess ) -> AttrVec {
49
49
psess. dcx ( ) . span_delayed_bug (
50
50
self . attrs . get ( 0 ) . map ( |attr| attr. span ) . unwrap_or ( DUMMY_SP ) ,
51
51
"AttrVec is taken for recovery but no error is produced" ,
@@ -56,12 +56,12 @@ impl AttrWrapper {
56
56
57
57
/// Prepend `self.attrs` to `attrs`.
58
58
// 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 ) {
60
60
mem:: swap ( attrs, & mut self . attrs ) ;
61
61
attrs. extend ( self . attrs ) ;
62
62
}
63
63
64
- pub fn is_empty ( & self ) -> bool {
64
+ pub ( super ) fn is_empty ( & self ) -> bool {
65
65
self . attrs . is_empty ( )
66
66
}
67
67
}
@@ -197,7 +197,7 @@ impl<'a> Parser<'a> {
197
197
/// } // 32..33
198
198
/// } // 33..34
199
199
/// ```
200
- pub fn collect_tokens_trailing_token < R : HasAttrs + HasTokens > (
200
+ pub ( super ) fn collect_tokens_trailing_token < R : HasAttrs + HasTokens > (
201
201
& mut self ,
202
202
attrs : AttrWrapper ,
203
203
force_collect : ForceCollect ,
0 commit comments