@@ -411,7 +411,6 @@ impl TtParser {
411411 /// track of through the mps generated.
412412 fn parse_tt_inner (
413413 & mut self ,
414- sess : & ParseSess ,
415414 matcher : & [ MatcherLoc ] ,
416415 token : & Token ,
417416 ) -> Option < NamedParseResult > {
@@ -519,11 +518,9 @@ impl TtParser {
519518 self . bb_mps . push ( mp) ;
520519 }
521520 } else {
521+ // E.g. `$e` instead of `$e:expr`, reported as a hard error if actually used.
522522 // Both this check and the one in `nameize` are necessary, surprisingly.
523- if sess. missing_fragment_specifiers . borrow_mut ( ) . remove ( & span) . is_some ( ) {
524- // E.g. `$e` instead of `$e:expr`.
525- return Some ( Error ( span, "missing fragment specifier" . to_string ( ) ) ) ;
526- }
523+ return Some ( Error ( span, "missing fragment specifier" . to_string ( ) ) ) ;
527524 }
528525 }
529526 MatcherLoc :: Eof => {
@@ -549,7 +546,7 @@ impl TtParser {
549546 // Need to take ownership of the matches from within the `Lrc`.
550547 Lrc :: make_mut ( & mut eof_mp. matches ) ;
551548 let matches = Lrc :: try_unwrap ( eof_mp. matches ) . unwrap ( ) . into_iter ( ) ;
552- self . nameize ( sess , matcher, matches)
549+ self . nameize ( matcher, matches)
553550 }
554551 EofMatcherPositions :: Multiple => {
555552 Error ( token. span , "ambiguity: multiple successful parses" . to_string ( ) )
@@ -587,7 +584,7 @@ impl TtParser {
587584
588585 // Process `cur_mps` until either we have finished the input or we need to get some
589586 // parsing from the black-box parser done.
590- if let Some ( res) = self . parse_tt_inner ( & parser . sess , matcher, & parser. token ) {
587+ if let Some ( res) = self . parse_tt_inner ( matcher, & parser. token ) {
591588 return res;
592589 }
593590
@@ -694,7 +691,6 @@ impl TtParser {
694691
695692 fn nameize < I : Iterator < Item = NamedMatch > > (
696693 & self ,
697- sess : & ParseSess ,
698694 matcher : & [ MatcherLoc ] ,
699695 mut res : I ,
700696 ) -> NamedParseResult {
@@ -711,11 +707,9 @@ impl TtParser {
711707 }
712708 } ;
713709 } else {
710+ // E.g. `$e` instead of `$e:expr`, reported as a hard error if actually used.
714711 // Both this check and the one in `parse_tt_inner` are necessary, surprisingly.
715- if sess. missing_fragment_specifiers . borrow_mut ( ) . remove ( & span) . is_some ( ) {
716- // E.g. `$e` instead of `$e:expr`.
717- return Error ( span, "missing fragment specifier" . to_string ( ) ) ;
718- }
712+ return Error ( span, "missing fragment specifier" . to_string ( ) ) ;
719713 }
720714 }
721715 }
0 commit comments