@@ -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,15 +212,15 @@ 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 ) ]
215
+ #[ derive( Copy , Clone , Debug ) ]
215
216
pub enum Capturing {
216
217
/// We aren't performing any capturing - this is the default mode.
217
218
No ,
218
219
/// We are capturing tokens
219
220
Yes ,
220
221
}
221
222
222
- #[ derive( Clone ) ]
223
+ #[ derive( Clone , Debug ) ]
223
224
struct CaptureState {
224
225
capturing : Capturing ,
225
226
replace_ranges : Vec < ReplaceRange > ,
@@ -230,7 +231,7 @@ struct CaptureState {
230
231
/// we (a) lex tokens into a nice tree structure (`TokenStream`), and then (b)
231
232
/// use this type to emit them as a linear sequence. But a linear sequence is
232
233
/// what the parser expects, for the most part.
233
- #[ derive( Clone ) ]
234
+ #[ derive( Clone , Debug ) ]
234
235
struct TokenCursor {
235
236
// Cursor for the current (innermost) token stream. The delimiters for this
236
237
// token stream are found in `self.stack.last()`; when that is `None` then
@@ -335,6 +336,7 @@ enum TokenExpectType {
335
336
}
336
337
337
338
/// A sequence separator.
339
+ #[ derive( Debug ) ]
338
340
struct SeqSep {
339
341
/// The separator token.
340
342
sep : Option < TokenKind > ,
@@ -352,6 +354,7 @@ impl SeqSep {
352
354
}
353
355
}
354
356
357
+ #[ derive( Debug ) ]
355
358
pub enum FollowedByType {
356
359
Yes ,
357
360
No ,
@@ -376,7 +379,7 @@ pub enum Trailing {
376
379
Yes ,
377
380
}
378
381
379
- #[ derive( Clone , Copy , PartialEq , Eq ) ]
382
+ #[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
380
383
pub enum TokenDescription {
381
384
ReservedIdentifier ,
382
385
Keyword ,
0 commit comments