about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/parser.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-04-18 20:18:13 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-04-02 16:07:02 +1100
commitbb495d6d3e6dae294f08162097bd85f904e9f90b (patch)
tree3c2779808f664b964e1c1a8c2dde2cfcb62b8328 /compiler/rustc_attr_parsing/src/parser.rs
parent70dab5a27c03a5637cc1d4ba36a5139760d25e38 (diff)
downloadrust-bb495d6d3e6dae294f08162097bd85f904e9f90b.tar.gz
rust-bb495d6d3e6dae294f08162097bd85f904e9f90b.zip
Remove `NtBlock`, `Nonterminal`, and `TokenKind::Interpolated`.
`NtBlock` is the last remaining variant of `Nonterminal`, so once it is
gone then `Nonterminal` can be removed as well.
Diffstat (limited to 'compiler/rustc_attr_parsing/src/parser.rs')
-rw-r--r--compiler/rustc_attr_parsing/src/parser.rs20
1 files changed, 1 insertions, 19 deletions
diff --git a/compiler/rustc_attr_parsing/src/parser.rs b/compiler/rustc_attr_parsing/src/parser.rs
index a8a1460591c..384fae59873 100644
--- a/compiler/rustc_attr_parsing/src/parser.rs
+++ b/compiler/rustc_attr_parsing/src/parser.rs
@@ -485,25 +485,7 @@ impl<'a> MetaItemListParserContext<'a> {
         }
 
         // or a path.
-        let path =
-            if let Some(TokenTree::Token(Token { kind: token::Interpolated(_), span, .. }, _)) =
-                self.inside_delimiters.peek()
-            {
-                self.inside_delimiters.next();
-                // We go into this path if an expr ended up in an attribute that
-                // expansion did not turn into a literal. Say, `#[repr(align(macro!()))]`
-                // where the macro didn't expand to a literal. An error is already given
-                // for this at this point, and then we do continue. This makes this path
-                // reachable...
-                let e = self.dcx.span_delayed_bug(
-                    *span,
-                    "expr in place where literal is expected (builtin attr parsing)",
-                );
-
-                return Some(MetaItemOrLitParser::Err(*span, e));
-            } else {
-                self.next_path()?
-            };
+        let path = self.next_path()?;
 
         // Paths can be followed by:
         // - `(more meta items)` (another list)