fn extra_tokens_diag(&mut self, additional_diags: impl Fn(Diagnostic, Span) -> Diagnostic) {
        while matches!(self.peek().ty, TT::CloseParen | TT::CloseBracket) {
            let tok = self.next();
            self.push_diag(UnmatchedClosingDelimiter!(tok.span, tok.ty));
        }

        if self.done() {
            return;
        }

        let first_tok_span = self.peek().span;
        let Span { lo, mut hi } = first_tok_span;
        while self.peek().ty != TT::Eof {
            hi = self.next().span.hi;
        }
        let diag = additional_diags(ExtraTokens!(lo..hi), first_tok_span);
        self.push_diag(diag);
    }
/// Creates diagnostics for extra tokens following a primary item.
/// All remaining tokens will be consumed in the construction of the diagnostic.
///
/// `additional_diags` applies additional diagnostic messages to the extra tokens diagnostic,
/// if one is produced.
Creates diagnostics for extra tokens following a primary item.
All remaining tokens will be consumed in the construction of the diagnostic.

`additional_diags` applies additional diagnostic messages to the extra tokens diagnostic,
if one is produced.
Creates diagnostics for extra tokens following a primary item . All remaining tokens will be consumed in the construction of the diagnostic . ` additional_diags ` applies additional diagnostic messages to the extra tokens diagnostic if one is produced .
fn extra_tokens_diag(&mut self, additional_diags: impl Fn(Diagnostic, Span) -> Diagnostic) {
        while matches!(self.peek().ty, TT::CloseParen | TT::CloseBracket) {
            let tok = self.next();
            self.push_diag(UnmatchedClosingDelimiter!(tok.span, tok.ty));
        }
        if self.done() {
            return;
        }
        let first_tok_span = self.peek().span;
        let Span { lo, mut hi } = first_tok_span;
        while self.peek().ty != TT::Eof {
            hi = self.next().span.hi;
        }
        let diag = additional_diags(ExtraTokens!(lo..hi), first_tok_span);
        self.push_diag(diag);
    }
fn extra_tokens_diag ( & mut self , additional_diags : impl Fn ( Diagnostic , Span ) -> Diagnostic ) { while matches ! ( self peek ( ) ty TT CloseParen TT CloseBracket ) { let tok = self . next ( ) ; self . push_diag ( UnmatchedClosingDelimiter ! ( tok span tok ty ) ) ; } if self . done ( ) { return ; } let first_tok_span = self . peek ( ) . span ; let Span { lo , mut hi } = first_tok_span ; while self . peek ( ) . ty != TT :: Eof { hi = self . next ( ) . span . hi ; } let diag = additional_diags ( ExtraTokens ! ( lo hi ) , first_tok_span ) ; self . push_diag ( diag ) ; }
Creates diagnostics for extra tokens following a primary item.
Creates diagnostics for extra tokens following a primary item .
&mut self
additional_diags
impl Fn(Diagnostic, Span) -> Diagnostic
&mut self
additional_diags
impl Fn(Diagnostic, Span) -> Diagnostic