rust/compiler/rustc_ast_pretty/src/pprust
Nicholas Nethercote 95e519ecbf Remove NtIdent and NtLifetime.
The extra span is now recorded in the new `TokenKind::NtIdent` and
`TokenKind::NtLifetime`. These both consist of a single token, and so
there's no operator precedence problems with inserting them directly
into the token stream.

The other way to do this would be to wrap the ident/lifetime in invisible
delimiters, but there's a lot of code that assumes an interpolated
ident/lifetime fits in a single token, and changing all that code to work with
invisible delimiters would have been a pain. (Maybe it could be done in a
follow-up.)

This change might not seem like much of a win, but it's a first step toward the
much bigger and long-desired removal of `Nonterminal` and
`TokenKind::Interpolated`. That change is big and complex enough that it's
worth doing this piece separately. (Indeed, this commit is based on part of a
late commit in #114647, a prior attempt at that big and complex change.)
2024-05-14 08:19:58 +10:00
..
state Fix redundant parens around braced macro call in match arms 2024-05-11 18:18:20 -07:00
mod.rs Fix suggestion for E0404 not dealing with multiple generics 2023-06-15 18:19:09 +08:00
state.rs Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
tests.rs Avoid unnecessary rustc_span::DUMMY_SP usage. 2024-04-16 15:55:24 +10:00