diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index f5c7186bc4b..c9a06728856 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -263,14 +263,14 @@ fn generic_extension<'cx, 'tt>( // Ignore the delimiters on the RHS. let rhs = match &rhses[i] { - mbe::TokenTree::Delimited(_, delimited) => delimited.tts.to_vec(), + mbe::TokenTree::Delimited(_, delimited) => &delimited.tts, _ => cx.span_bug(sp, "malformed macro rhs"), }; let arm_span = rhses[i].span(); let rhs_spans = rhs.iter().map(|t| t.span()).collect::>(); // rhs has holes ( `$id` and `$(...)` that need filled) - let mut tts = match transcribe(cx, &named_matches, rhs, transparency) { + let mut tts = match transcribe(cx, &named_matches, &rhs, transparency) { Ok(tts) => tts, Err(mut err) => { err.emit(); diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs index ca2908d7923..d25f044234c 100644 --- a/compiler/rustc_expand/src/mbe/transcribe.rs +++ b/compiler/rustc_expand/src/mbe/transcribe.rs @@ -85,7 +85,7 @@ impl<'a> Iterator for Frame<'a> { pub(super) fn transcribe<'a>( cx: &ExtCtxt<'a>, interp: &FxHashMap, - src: Vec, + src: &[mbe::TokenTree], transparency: Transparency, ) -> PResult<'a, TokenStream> { // Nothing for us to transcribe...