@@ -400,7 +400,7 @@ pub fn compile_declarative_macro(
400400    let  diag = & sess. parse_sess . span_diagnostic ; 
401401    let  lhs_nm = Ident :: new ( sym:: lhs,  def. span ) ; 
402402    let  rhs_nm = Ident :: new ( sym:: rhs,  def. span ) ; 
403-     let  tt_spec = Some ( NonterminalKind :: TT ) ; 
403+     let  tt_spec = NonterminalKind :: TT ; 
404404
405405    // Parse the macro_rules! invocation 
406406    let  ( macro_rules,  body)  = match  & def. kind  { 
@@ -577,7 +577,7 @@ fn check_lhs_no_empty_seq(sess: &ParseSess, tts: &[mbe::TokenTree]) -> bool {
577577            TokenTree :: Sequence ( span,  ref  seq)  => { 
578578                if  seq. separator . is_none ( ) 
579579                    && seq. tts . iter ( ) . all ( |seq_tt| match  * seq_tt { 
580-                         TokenTree :: MetaVarDecl ( _,  _,  Some ( NonterminalKind :: Vis ) )  => true , 
580+                         TokenTree :: MetaVarDecl ( _,  _,  NonterminalKind :: Vis )  => true , 
581581                        TokenTree :: Sequence ( _,  ref  sub_seq)  => { 
582582                            sub_seq. kleene . op  == mbe:: KleeneOp :: ZeroOrMore 
583583                                || sub_seq. kleene . op  == mbe:: KleeneOp :: ZeroOrOne 
@@ -960,7 +960,7 @@ fn check_matcher_core(
960960        // Now `last` holds the complete set of NT tokens that could 
961961        // end the sequence before SUFFIX. Check that every one works with `suffix`. 
962962        for  token in  & last. tokens  { 
963-             if  let  TokenTree :: MetaVarDecl ( _,  name,  Some ( kind) )  = * token { 
963+             if  let  TokenTree :: MetaVarDecl ( _,  name,  kind)  = * token { 
964964                for  next_token in  & suffix_first. tokens  { 
965965                    match  is_in_follow ( next_token,  kind)  { 
966966                        IsInFollow :: Yes  => { } 
@@ -1018,7 +1018,7 @@ fn check_matcher_core(
10181018} 
10191019
10201020fn  token_can_be_followed_by_any ( tok :  & mbe:: TokenTree )  -> bool  { 
1021-     if  let  mbe:: TokenTree :: MetaVarDecl ( _,  _,  Some ( kind) )  = * tok { 
1021+     if  let  mbe:: TokenTree :: MetaVarDecl ( _,  _,  kind)  = * tok { 
10221022        frag_can_be_followed_by_any ( kind) 
10231023    }  else  { 
10241024        // (Non NT's can always be followed by anything in matchers.) 
@@ -1123,7 +1123,7 @@ fn is_in_follow(tok: &mbe::TokenTree, kind: NonterminalKind) -> IsInFollow {
11231123                        } 
11241124                        _ => IsInFollow :: No ( TOKENS ) , 
11251125                    } , 
1126-                     TokenTree :: MetaVarDecl ( _,  _,  Some ( NonterminalKind :: Block ) )  => IsInFollow :: Yes , 
1126+                     TokenTree :: MetaVarDecl ( _,  _,  NonterminalKind :: Block )  => IsInFollow :: Yes , 
11271127                    _ => IsInFollow :: No ( TOKENS ) , 
11281128                } 
11291129            } 
@@ -1158,7 +1158,7 @@ fn is_in_follow(tok: &mbe::TokenTree, kind: NonterminalKind) -> IsInFollow {
11581158                    TokenTree :: MetaVarDecl ( 
11591159                        _, 
11601160                        _, 
1161-                         Some ( NonterminalKind :: Ident  | NonterminalKind :: Ty  | NonterminalKind :: Path ) , 
1161+                         NonterminalKind :: Ident  | NonterminalKind :: Ty  | NonterminalKind :: Path , 
11621162                    )  => IsInFollow :: Yes , 
11631163                    _ => IsInFollow :: No ( TOKENS ) , 
11641164                } 
@@ -1171,8 +1171,7 @@ fn quoted_tt_to_string(tt: &mbe::TokenTree) -> String {
11711171    match  * tt { 
11721172        mbe:: TokenTree :: Token ( ref  token)  => pprust:: token_to_string ( & token) , 
11731173        mbe:: TokenTree :: MetaVar ( _,  name)  => format ! ( "${}" ,  name) , 
1174-         mbe:: TokenTree :: MetaVarDecl ( _,  name,  Some ( kind) )  => format ! ( "${}:{}" ,  name,  kind) , 
1175-         mbe:: TokenTree :: MetaVarDecl ( _,  name,  None )  => format ! ( "${}:" ,  name) , 
1174+         mbe:: TokenTree :: MetaVarDecl ( _,  name,  kind)  => format ! ( "${}:{}" ,  name,  kind) , 
11761175        _ => panic ! ( 
11771176            "unexpected mbe::TokenTree::{{Sequence or Delimited}} \  
11781177              in follow set checker"
0 commit comments