@@ -182,15 +182,6 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: bool) -> bool {
182182 . contains ( & name)
183183}
184184
185- /// A hack used to pass AST fragments to attribute and derive macros
186- /// as a single nonterminal token instead of a token stream.
187- /// FIXME: It needs to be removed, but there are some compatibility issues (see #73345).
188- #[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Debug , HashStable_Generic ) ]
189- pub enum FlattenGroup {
190- Yes ,
191- No ,
192- }
193-
194185#[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Debug , HashStable_Generic ) ]
195186pub enum TokenKind {
196187 /* Expression-operator symbols. */
@@ -245,7 +236,7 @@ pub enum TokenKind {
245236 /// treat regular and interpolated lifetime identifiers in the same way.
246237 Lifetime ( Symbol ) ,
247238
248- Interpolated ( Lrc < Nonterminal > , FlattenGroup ) ,
239+ Interpolated ( Lrc < Nonterminal > ) ,
249240
250241 // Can be expanded into several tokens.
251242 /// A doc comment.
@@ -352,7 +343,7 @@ impl Token {
352343 /// if they keep spans or perform edition checks.
353344 pub fn uninterpolated_span ( & self ) -> Span {
354345 match & self . kind {
355- Interpolated ( nt, _ ) => nt. span ( ) ,
346+ Interpolated ( nt) => nt. span ( ) ,
356347 _ => self . span ,
357348 }
358349 }
@@ -391,7 +382,7 @@ impl Token {
391382 ModSep | // global path
392383 Lifetime ( ..) | // labeled loop
393384 Pound => true , // expression attributes
394- Interpolated ( ref nt, _ ) => match * * nt {
385+ Interpolated ( ref nt) => match * * nt {
395386 NtLiteral ( ..) |
396387 NtExpr ( ..) |
397388 NtBlock ( ..) |
@@ -417,7 +408,7 @@ impl Token {
417408 Lifetime ( ..) | // lifetime bound in trait object
418409 Lt | BinOp ( Shl ) | // associated path
419410 ModSep => true , // global path
420- Interpolated ( ref nt, _ ) => match * * nt {
411+ Interpolated ( ref nt) => match * * nt {
421412 NtTy ( ..) | NtPath ( ..) => true ,
422413 _ => false ,
423414 } ,
@@ -429,7 +420,7 @@ impl Token {
429420 pub fn can_begin_const_arg ( & self ) -> bool {
430421 match self . kind {
431422 OpenDelim ( Brace ) => true ,
432- Interpolated ( ref nt, _ ) => match * * nt {
423+ Interpolated ( ref nt) => match * * nt {
433424 NtExpr ( ..) | NtBlock ( ..) | NtLiteral ( ..) => true ,
434425 _ => false ,
435426 } ,
@@ -464,7 +455,7 @@ impl Token {
464455 match self . uninterpolate ( ) . kind {
465456 Literal ( ..) | BinOp ( Minus ) => true ,
466457 Ident ( name, false ) if name. is_bool_lit ( ) => true ,
467- Interpolated ( ref nt, _ ) => match & * * nt {
458+ Interpolated ( ref nt) => match & * * nt {
468459 NtLiteral ( _) => true ,
469460 NtExpr ( e) => match & e. kind {
470461 ast:: ExprKind :: Lit ( _) => true ,
@@ -485,7 +476,7 @@ impl Token {
485476 // otherwise returns the original token.
486477 pub fn uninterpolate ( & self ) -> Cow < ' _ , Token > {
487478 match & self . kind {
488- Interpolated ( nt, _ ) => match * * nt {
479+ Interpolated ( nt) => match * * nt {
489480 NtIdent ( ident, is_raw) => {
490481 Cow :: Owned ( Token :: new ( Ident ( ident. name , is_raw) , ident. span ) )
491482 }
@@ -532,7 +523,7 @@ impl Token {
532523
533524 /// Returns `true` if the token is an interpolated path.
534525 fn is_path ( & self ) -> bool {
535- if let Interpolated ( ref nt, _ ) = self . kind {
526+ if let Interpolated ( ref nt) = self . kind {
536527 if let NtPath ( ..) = * * nt {
537528 return true ;
538529 }
@@ -544,7 +535,7 @@ impl Token {
544535 /// That is, is this a pre-parsed expression dropped into the token stream
545536 /// (which happens while parsing the result of macro expansion)?
546537 pub fn is_whole_expr ( & self ) -> bool {
547- if let Interpolated ( ref nt, _ ) = self . kind {
538+ if let Interpolated ( ref nt) = self . kind {
548539 if let NtExpr ( _) | NtLiteral ( _) | NtPath ( _) | NtIdent ( ..) | NtBlock ( _) = * * nt {
549540 return true ;
550541 }
@@ -555,7 +546,7 @@ impl Token {
555546
556547 // Is the token an interpolated block (`$b:block`)?
557548 pub fn is_whole_block ( & self ) -> bool {
558- if let Interpolated ( ref nt, _ ) = self . kind {
549+ if let Interpolated ( ref nt) = self . kind {
559550 if let NtBlock ( ..) = * * nt {
560551 return true ;
561552 }
0 commit comments