rust/compiler/rustc_expand/src
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
..
mbe Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
base.rs Inline and remove three DummyResult methods. 2024-05-03 09:06:26 +10:00
build.rs Remove unused ExpCtxt methods. 2024-05-03 09:06:25 +10:00
config.rs Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
errors.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
expand.rs Rollup merge of #123344 - pietroalbini:pa-unused-imports, r=Nilstrieb 2024-05-08 23:33:24 +02:00
lib.rs Move some tests from rustc_expand to rustc_parse. 2024-05-06 09:06:02 +10:00
mbe.rs Remove unnecessary pubs. 2024-05-03 09:06:26 +10:00
module.rs Use do yeet () and do yeet _ instead of None? and Err(_)? in compiler 2024-03-15 11:37:42 +00:00
placeholders.rs Add ErrorGuaranteed to Recovered::Yes and use it more. 2024-05-09 20:12:07 +10:00
proc_macro_server.rs Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
proc_macro.rs Remove a Span from TokenKind::Interpolated. 2024-05-13 10:30:30 +10:00