From aa6fba98ae717d6090cdd5d0569114adfc825680 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 5 Jun 2019 01:17:07 +0300 Subject: syntax: Use `Token` in `Parser` --- src/libsyntax_ext/asm.rs | 2 +- src/libsyntax_ext/assert.rs | 2 +- src/libsyntax_ext/format.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libsyntax_ext') diff --git a/src/libsyntax_ext/asm.rs b/src/libsyntax_ext/asm.rs index 83c4c809de3..b015815ac9c 100644 --- a/src/libsyntax_ext/asm.rs +++ b/src/libsyntax_ext/asm.rs @@ -260,7 +260,7 @@ fn parse_inline_asm<'a>( loop { // MOD_SEP is a double colon '::' without space in between. // When encountered, the state must be advanced twice. - match (&p.token, state.next(), state.next().next()) { + match (&p.token.kind, state.next(), state.next().next()) { (&token::Colon, StateNone, _) | (&token::ModSep, _, StateNone) => { p.bump(); diff --git a/src/libsyntax_ext/assert.rs b/src/libsyntax_ext/assert.rs index 8a297a5c9bc..e5e422c4d9c 100644 --- a/src/libsyntax_ext/assert.rs +++ b/src/libsyntax_ext/assert.rs @@ -103,7 +103,7 @@ fn parse_assert<'a>( // // Parse this as an actual message, and suggest inserting a comma. Eventually, this should be // turned into an error. - let custom_message = if let token::Literal(token::Lit { kind: token::Str, .. }) = parser.token { + let custom_message = if let token::Literal(token::Lit { kind: token::Str, .. }) = parser.token.kind { let mut err = cx.struct_span_warn(parser.span, "unexpected string literal"); let comma_span = cx.source_map().next_point(parser.prev_span); err.span_suggestion_short( diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index b5be45547cf..0eaac544e33 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -149,7 +149,7 @@ fn parse_args<'a>( } // accept trailing commas if named || (p.token.is_ident() && p.look_ahead(1, |t| *t == token::Eq)) { named = true; - let ident = if let token::Ident(i, _) = p.token { + let ident = if let token::Ident(i, _) = p.token.kind { p.bump(); i } else { -- cgit 1.4.1-3-g733a5