@@ -401,7 +401,7 @@ crate enum TokenType {
401401impl TokenType {
402402 crate fn to_string ( & self ) -> String {
403403 match * self {
404- TokenType :: Token ( ref t) => format ! ( "`{}`" , pprust:: token_to_string ( t) ) ,
404+ TokenType :: Token ( ref t) => format ! ( "`{}`" , pprust:: token_kind_to_string ( t) ) ,
405405 TokenType :: Keyword ( kw) => format ! ( "`{}`" , kw) ,
406406 TokenType :: Operator => "an operator" . to_string ( ) ,
407407 TokenType :: Lifetime => "lifetime" . to_string ( ) ,
@@ -418,7 +418,7 @@ impl TokenType {
418418///
419419/// Types can also be of the form `IDENT(u8, u8) -> u8`, however this assumes
420420/// that `IDENT` is not the ident of a fn trait.
421- fn can_continue_type_after_non_fn_ident ( t : & TokenKind ) -> bool {
421+ fn can_continue_type_after_non_fn_ident ( t : & Token ) -> bool {
422422 t == & token:: ModSep || t == & token:: Lt ||
423423 t == & token:: BinOp ( token:: Shl )
424424}
@@ -586,10 +586,10 @@ impl<'a> Parser<'a> {
586586 edible : & [ TokenKind ] ,
587587 inedible : & [ TokenKind ] ,
588588 ) -> PResult < ' a , bool /* recovered */ > {
589- if edible. contains ( & self . token ) {
589+ if edible. contains ( & self . token . kind ) {
590590 self . bump ( ) ;
591591 Ok ( false )
592- } else if inedible. contains ( & self . token ) {
592+ } else if inedible. contains ( & self . token . kind ) {
593593 // leave it in the input
594594 Ok ( false )
595595 } else if self . last_unexpected_token_span == Some ( self . token . span ) {
@@ -951,7 +951,7 @@ impl<'a> Parser<'a> {
951951 Err ( mut e) => {
952952 // Attempt to keep parsing if it was a similar separator
953953 if let Some ( ref tokens) = t. similar_tokens ( ) {
954- if tokens. contains ( & self . token ) {
954+ if tokens. contains ( & self . token . kind ) {
955955 self . bump ( ) ;
956956 }
957957 }
@@ -1756,7 +1756,7 @@ impl<'a> Parser<'a> {
17561756 fn parse_path_segment ( & mut self , style : PathStyle ) -> PResult < ' a , PathSegment > {
17571757 let ident = self . parse_path_segment_ident ( ) ?;
17581758
1759- let is_args_start = |token : & TokenKind | match * token {
1759+ let is_args_start = |token : & Token | match token. kind {
17601760 token:: Lt | token:: BinOp ( token:: Shl ) | token:: OpenDelim ( token:: Paren )
17611761 | token:: LArrow => true ,
17621762 _ => false ,
@@ -2822,7 +2822,7 @@ impl<'a> Parser<'a> {
28222822 LhsExpr :: AttributesParsed ( attrs) => Some ( attrs) ,
28232823 _ => None ,
28242824 } ;
2825- if [ token:: DotDot , token:: DotDotDot , token:: DotDotEq ] . contains ( & self . token ) {
2825+ if [ token:: DotDot , token:: DotDotDot , token:: DotDotEq ] . contains ( & self . token . kind ) {
28262826 return self . parse_prefix_range_expr ( attrs) ;
28272827 } else {
28282828 self . parse_prefix_expr ( attrs) ?
@@ -3099,7 +3099,7 @@ impl<'a> Parser<'a> {
30993099 self . err_dotdotdot_syntax ( self . token . span ) ;
31003100 }
31013101
3102- debug_assert ! ( [ token:: DotDot , token:: DotDotDot , token:: DotDotEq ] . contains( & self . token) ,
3102+ debug_assert ! ( [ token:: DotDot , token:: DotDotDot , token:: DotDotEq ] . contains( & self . token. kind ) ,
31033103 "parse_prefix_range_expr: token {:?} is not DotDot/DotDotEq" ,
31043104 self . token) ;
31053105 let tok = self . token . clone ( ) ;
@@ -7867,7 +7867,7 @@ pub fn emit_unclosed_delims(unclosed_delims: &mut Vec<UnmatchedBrace>, handler:
78677867 for unmatched in unclosed_delims. iter ( ) {
78687868 let mut err = handler. struct_span_err ( unmatched. found_span , & format ! (
78697869 "incorrect close delimiter: `{}`" ,
7870- pprust:: token_to_string ( & token:: CloseDelim ( unmatched. found_delim) ) ,
7870+ pprust:: token_kind_to_string ( & token:: CloseDelim ( unmatched. found_delim) ) ,
78717871 ) ) ;
78727872 err. span_label ( unmatched. found_span , "incorrect close delimiter" ) ;
78737873 if let Some ( sp) = unmatched. candidate_span {
0 commit comments