diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2025-09-19 21:38:12 +0800 |
|---|---|---|
| committer | Josh Triplett <josh@joshtriplett.org> | 2025-09-20 10:38:36 +0800 |
| commit | fc41c38379ab186fee7dab193ae94813592f818c (patch) | |
| tree | 1af322a8ce13458989615bee68692313187deb82 | |
| parent | bb430f8e1e4081b7600ef2bf6ff7207ea6b5d83f (diff) | |
| download | rust-fc41c38379ab186fee7dab193ae94813592f818c.tar.gz rust-fc41c38379ab186fee7dab193ae94813592f818c.zip | |
mbe: Factor out a function to transcribe a `ParseNtResult`
| -rw-r--r-- | compiler/rustc_expand/src/mbe/transcribe.rs | 8 |
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 |
