@@ -19,6 +19,7 @@ pub(crate) use item::FnParseMode;
19
19
pub use pat:: { CommaRecoveryMode , RecoverColon , RecoverComma } ;
20
20
pub use path:: PathStyle ;
21
21
22
+ use core:: fmt;
22
23
use rustc_ast:: ptr:: P ;
23
24
use rustc_ast:: token:: { self , Delimiter , Token , TokenKind } ;
24
25
use rustc_ast:: tokenstream:: { AttributesData , DelimSpacing , DelimSpan , Spacing } ;
@@ -46,7 +47,7 @@ use crate::errors::{
46
47
} ;
47
48
48
49
bitflags:: bitflags! {
49
- #[ derive( Clone , Copy ) ]
50
+ #[ derive( Clone , Copy , Debug ) ]
50
51
struct Restrictions : u8 {
51
52
const STMT_EXPR = 1 << 0 ;
52
53
const NO_STRUCT_LITERAL = 1 << 1 ;
@@ -72,7 +73,7 @@ enum BlockMode {
72
73
73
74
/// Whether or not we should force collection of tokens for an AST node,
74
75
/// regardless of whether or not it has attributes
75
- #[ derive( Clone , Copy , PartialEq ) ]
76
+ #[ derive( Clone , Copy , Debug , PartialEq ) ]
76
77
pub enum ForceCollect {
77
78
Yes ,
78
79
No ,
@@ -120,7 +121,7 @@ macro_rules! maybe_recover_from_interpolated_ty_qpath {
120
121
} ;
121
122
}
122
123
123
- #[ derive( Clone , Copy ) ]
124
+ #[ derive( Clone , Copy , Debug ) ]
124
125
pub enum Recovery {
125
126
Allowed ,
126
127
Forbidden ,
@@ -182,7 +183,7 @@ pub struct Parser<'a> {
182
183
rustc_data_structures:: static_assert_size!( Parser <' _>, 264 ) ;
183
184
184
185
/// Stores span information about a closure.
185
- #[ derive( Clone ) ]
186
+ #[ derive( Clone , Debug ) ]
186
187
pub struct ClosureSpans {
187
188
pub whole_closure : Span ,
188
189
pub closing_pipe : Span ,
@@ -211,7 +212,7 @@ pub type ReplaceRange = (Range<u32>, Vec<(FlatToken, Spacing)>);
211
212
/// Controls how we capture tokens. Capturing can be expensive,
212
213
/// so we try to avoid performing capturing in cases where
213
214
/// we will never need an `AttrTokenStream`.
214
- #[ derive( Copy , Clone , Default ) ]
215
+ #[ derive( Copy , Clone , Debug , Default ) ]
215
216
pub enum Capturing {
216
217
/// We aren't performing any capturing
217
218
#[ default]
@@ -220,7 +221,7 @@ pub enum Capturing {
220
221
Yes ,
221
222
}
222
223
223
- #[ derive( Clone ) ]
224
+ #[ derive( Clone , Debug ) ]
224
225
struct CaptureState {
225
226
capturing : Capturing ,
226
227
replace_ranges : Vec < ReplaceRange > ,
@@ -231,7 +232,7 @@ struct CaptureState {
231
232
/// we (a) lex tokens into a nice tree structure (`TokenStream`), and then (b)
232
233
/// use this type to emit them as a linear sequence. But a linear sequence is
233
234
/// what the parser expects, for the most part.
234
- #[ derive( Clone ) ]
235
+ #[ derive( Clone , Debug ) ]
235
236
struct TokenCursor {
236
237
// Cursor for the current (innermost) token stream. The delimiters for this
237
238
// token stream are found in `self.stack.last()`; when that is `None` then
@@ -336,6 +337,7 @@ enum TokenExpectType {
336
337
}
337
338
338
339
/// A sequence separator.
340
+ #[ derive( Debug ) ]
339
341
struct SeqSep {
340
342
/// The separator token.
341
343
sep : Option < TokenKind > ,
@@ -353,6 +355,7 @@ impl SeqSep {
353
355
}
354
356
}
355
357
358
+ #[ derive( Debug ) ]
356
359
pub enum FollowedByType {
357
360
Yes ,
358
361
No ,
@@ -377,7 +380,7 @@ pub enum Trailing {
377
380
Yes ,
378
381
}
379
382
380
- #[ derive( Clone , Copy , PartialEq , Eq ) ]
383
+ #[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
381
384
pub enum TokenDescription {
382
385
ReservedIdentifier ,
383
386
Keyword ,
0 commit comments