|
1 | 1 | use rustc_ast::ast; |
2 | 2 | use rustc_ast::ptr::P; |
3 | | -use rustc_ast::token::TokenKind; |
| 3 | +use rustc_ast::token; |
4 | 4 | use rustc_ast::tokenstream::TokenStream; |
5 | | -use rustc_span::symbol::{self, kw}; |
| 5 | +use rustc_parse::exp; |
| 6 | +use rustc_span::symbol; |
6 | 7 |
|
7 | 8 | use crate::rewrite::RewriteContext; |
8 | 9 |
|
@@ -31,19 +32,19 @@ pub(crate) fn parse_lazy_static( |
31 | 32 | } |
32 | 33 | } |
33 | 34 | } |
34 | | - while parser.token.kind != TokenKind::Eof { |
| 35 | + while parser.token.kind != token::Eof { |
35 | 36 | // Parse a `lazy_static!` item. |
36 | 37 | // FIXME: These `eat_*` calls should be converted to `parse_or` to avoid |
37 | 38 | // silently formatting malformed lazy-statics. |
38 | 39 | let vis = parse_or!(parse_visibility, rustc_parse::parser::FollowedByType::No); |
39 | | - let _ = parser.eat_keyword(kw::Static); |
40 | | - let _ = parser.eat_keyword(kw::Ref); |
| 40 | + let _ = parser.eat_keyword(exp!(Static)); |
| 41 | + let _ = parser.eat_keyword(exp!(Ref)); |
41 | 42 | let id = parse_or!(parse_ident); |
42 | | - let _ = parser.eat(&TokenKind::Colon); |
| 43 | + let _ = parser.eat(exp!(Colon)); |
43 | 44 | let ty = parse_or!(parse_ty); |
44 | | - let _ = parser.eat(&TokenKind::Eq); |
| 45 | + let _ = parser.eat(exp!(Eq)); |
45 | 46 | let expr = parse_or!(parse_expr); |
46 | | - let _ = parser.eat(&TokenKind::Semi); |
| 47 | + let _ = parser.eat(exp!(Semi)); |
47 | 48 | result.push((vis, id, ty, expr)); |
48 | 49 | } |
49 | 50 |
|
|
0 commit comments