@@ -411,7 +411,6 @@ impl TtParser {
411
411
/// track of through the mps generated.
412
412
fn parse_tt_inner (
413
413
& mut self ,
414
- sess : & ParseSess ,
415
414
matcher : & [ MatcherLoc ] ,
416
415
token : & Token ,
417
416
) -> Option < NamedParseResult > {
@@ -519,11 +518,9 @@ impl TtParser {
519
518
self . bb_mps . push ( mp) ;
520
519
}
521
520
} else {
521
+ // E.g. `$e` instead of `$e:expr`, reported as a hard error if actually used.
522
522
// 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 ( ) ) ) ;
527
524
}
528
525
}
529
526
MatcherLoc :: Eof => {
@@ -549,7 +546,7 @@ impl TtParser {
549
546
// Need to take ownership of the matches from within the `Lrc`.
550
547
Lrc :: make_mut ( & mut eof_mp. matches ) ;
551
548
let matches = Lrc :: try_unwrap ( eof_mp. matches ) . unwrap ( ) . into_iter ( ) ;
552
- self . nameize ( sess , matcher, matches)
549
+ self . nameize ( matcher, matches)
553
550
}
554
551
EofMatcherPositions :: Multiple => {
555
552
Error ( token. span , "ambiguity: multiple successful parses" . to_string ( ) )
@@ -587,7 +584,7 @@ impl TtParser {
587
584
588
585
// Process `cur_mps` until either we have finished the input or we need to get some
589
586
// 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 ) {
591
588
return res;
592
589
}
593
590
@@ -694,7 +691,6 @@ impl TtParser {
694
691
695
692
fn nameize < I : Iterator < Item = NamedMatch > > (
696
693
& self ,
697
- sess : & ParseSess ,
698
694
matcher : & [ MatcherLoc ] ,
699
695
mut res : I ,
700
696
) -> NamedParseResult {
@@ -711,11 +707,9 @@ impl TtParser {
711
707
}
712
708
} ;
713
709
} else {
710
+ // E.g. `$e` instead of `$e:expr`, reported as a hard error if actually used.
714
711
// 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 ( ) ) ;
719
713
}
720
714
}
721
715
}
0 commit comments