diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-04-22 16:29:27 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-05-13 10:30:30 +1000 |
| commit | 9a63a42cb787476930f094fdbd9885251ae01de0 (patch) | |
| tree | 5e07fa7de037abee072ce2acf94ea0a730fd0a95 /compiler/rustc_ast/src/attr | |
| parent | 852a78ea8de3aa24c50457340d9560547bc67008 (diff) | |
Remove a `Span` from `TokenKind::Interpolated`.
This span records the declaration of the metavariable in the LHS of the macro. It's used in a couple of error messages. Unfortunately, it gets in the way of the long-term goal of removing `TokenKind::Interpolated`. So this commit removes it, which degrades a couple of (obscure) error messages but makes things simpler and enables the next commit.
Diffstat (limited to 'compiler/rustc_ast/src/attr')
| -rw-r--r-- | compiler/rustc_ast/src/attr/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs index 0f12fd31975..0684163617f 100644 --- a/compiler/rustc_ast/src/attr/mod.rs +++ b/compiler/rustc_ast/src/attr/mod.rs @@ -345,7 +345,7 @@ impl MetaItem { let span = span.with_hi(segments.last().unwrap().ident.span.hi()); Path { span, segments, tokens: None } } - Some(TokenTree::Token(Token { kind: token::Interpolated(nt), .. }, _)) => match &nt.0 { + Some(TokenTree::Token(Token { kind: token::Interpolated(nt), .. }, _)) => match &**nt { token::Nonterminal::NtMeta(item) => return item.meta(item.path.span), token::Nonterminal::NtPath(path) => (**path).clone(), _ => return None, |
