about summary refs log tree commit diff
path: root/compiler/rustc_expand
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2025-09-19 21:38:12 +0800
committerJosh Triplett <josh@joshtriplett.org>2025-09-20 10:38:36 +0800
commitfc41c38379ab186fee7dab193ae94813592f818c (patch)
tree1af322a8ce13458989615bee68692313187deb82 /compiler/rustc_expand
parentbb430f8e1e4081b7600ef2bf6ff7207ea6b5d83f (diff)
downloadrust-fc41c38379ab186fee7dab193ae94813592f818c.tar.gz
rust-fc41c38379ab186fee7dab193ae94813592f818c.zip
mbe: Factor out a function to transcribe a `ParseNtResult`
Diffstat (limited to 'compiler/rustc_expand')
-rw-r--r--compiler/rustc_expand/src/mbe/transcribe.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs
index 6a2cb5f5560..dddd62a4945 100644
--- a/compiler/rustc_expand/src/mbe/transcribe.rs
+++ b/compiler/rustc_expand/src/mbe/transcribe.rs
@@ -380,6 +380,14 @@ fn transcribe_metavar<'tx>(
         return Err(dcx.create_err(MacroVarStillRepeating { span: sp, ident }));
     };
 
+    transcribe_pnr(tscx, sp, pnr)
+}
+
+fn transcribe_pnr<'tx>(
+    tscx: &mut TranscrCtx<'tx, '_>,
+    mut sp: Span,
+    pnr: &ParseNtResult,
+) -> PResult<'tx, ()> {
     // We wrap the tokens in invisible delimiters, unless they are already wrapped
     // in invisible delimiters with the same `MetaVarKind`. Because some proc
     // macros can't handle multiple layers of invisible delimiters of the same