From ae5ed9b72914ea28749072cbaff86bc34a43884c Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 5 Jul 2019 12:25:34 -0400 Subject: [PATCH] Don't re-collect tokenstream twice to pretty print --- src/librustc_metadata/encoder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index c7f57be6426..567b6b1a891 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -1316,7 +1316,7 @@ impl EncodeContext<'tcx> { let def_id = self.tcx.hir().local_def_id(macro_def.hir_id); Entry { kind: EntryKind::MacroDef(self.lazy(&MacroDef { - body: pprust::tts_to_string(¯o_def.body.trees().collect::>()), + body: pprust::tokens_to_string(macro_def.body.clone()), legacy: macro_def.legacy, })), visibility: self.lazy(&ty::Visibility::Public),