@@ -3,14 +3,15 @@ use crate::errors::{
33 CountRepetitionMisplaced , MetaVarExprUnrecognizedVar , MetaVarsDifSeqMatchers , MustRepeatOnce ,
44 NoSyntaxVarsExprRepeat , VarStillRepeating ,
55} ;
6- use crate :: mbe:: macro_parser:: { MatchedNonterminal , MatchedSeq , MatchedTokenTree , NamedMatch } ;
6+ use crate :: mbe:: macro_parser:: { NamedMatch , NamedMatch :: * } ;
77use crate :: mbe:: { self , MetaVarExpr } ;
88use rustc_ast:: mut_visit:: { self , MutVisitor } ;
99use rustc_ast:: token:: { self , Delimiter , Token , TokenKind } ;
1010use rustc_ast:: tokenstream:: { DelimSpan , Spacing , TokenStream , TokenTree } ;
1111use rustc_data_structures:: fx:: FxHashMap ;
1212use rustc_errors:: { pluralize, PResult } ;
1313use rustc_errors:: { DiagnosticBuilder , ErrorGuaranteed } ;
14+ use rustc_parse:: parser:: ParseNtResult ;
1415use rustc_span:: hygiene:: { LocalExpnId , Transparency } ;
1516use rustc_span:: symbol:: { sym, Ident , MacroRulesNormalizedIdent } ;
1617use rustc_span:: Span ;
@@ -217,12 +218,12 @@ pub(super) fn transcribe<'a>(
217218 let ident = MacroRulesNormalizedIdent :: new ( original_ident) ;
218219 if let Some ( cur_matched) = lookup_cur_matched ( ident, interp, & repeats) {
219220 match cur_matched {
220- MatchedTokenTree ( tt ) => {
221+ MatchedSingle ( ParseNtResult :: Tt ( tt ) ) => {
221222 // `tt`s are emitted into the output stream directly as "raw tokens",
222223 // without wrapping them into groups.
223224 result. push ( tt. clone ( ) ) ;
224225 }
225- MatchedNonterminal ( nt ) => {
226+ MatchedSingle ( ParseNtResult :: Nt ( nt ) ) => {
226227 // Other variables are emitted into the output stream as groups with
227228 // `Delimiter::Invisible` to maintain parsing priorities.
228229 // `Interpolated` is currently used for such groups in rustc parser.
@@ -298,7 +299,7 @@ fn lookup_cur_matched<'a>(
298299 interpolations. get ( & ident) . map ( |mut matched| {
299300 for & ( idx, _) in repeats {
300301 match matched {
301- MatchedTokenTree ( _ ) | MatchedNonterminal ( _) => break ,
302+ MatchedSingle ( _) => break ,
302303 MatchedSeq ( ads) => matched = ads. get ( idx) . unwrap ( ) ,
303304 }
304305 }
@@ -388,7 +389,7 @@ fn lockstep_iter_size(
388389 let name = MacroRulesNormalizedIdent :: new ( * name) ;
389390 match lookup_cur_matched ( name, interpolations, repeats) {
390391 Some ( matched) => match matched {
391- MatchedTokenTree ( _ ) | MatchedNonterminal ( _) => LockstepIterSize :: Unconstrained ,
392+ MatchedSingle ( _) => LockstepIterSize :: Unconstrained ,
392393 MatchedSeq ( ads) => LockstepIterSize :: Constraint ( ads. len ( ) , name) ,
393394 } ,
394395 _ => LockstepIterSize :: Unconstrained ,
@@ -437,7 +438,7 @@ fn count_repetitions<'a>(
437438 sp : & DelimSpan ,
438439 ) -> PResult < ' a , usize > {
439440 match matched {
440- MatchedTokenTree ( _ ) | MatchedNonterminal ( _) => {
441+ MatchedSingle ( _) => {
441442 if declared_lhs_depth == 0 {
442443 return Err ( cx. create_err ( CountRepetitionMisplaced { span : sp. entire ( ) } ) ) ;
443444 }
0 commit comments