1
Fork 0

Don't re-collect tokenstream twice to pretty print

This commit is contained in:
Mark Rousskov 2019-07-05 12:25:34 -04:00
parent 11d521676f
commit ae5ed9b729

View file

@ -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(&macro_def.body.trees().collect::<Vec<_>>()),
body: pprust::tokens_to_string(macro_def.body.clone()),
legacy: macro_def.legacy,
})),
visibility: self.lazy(&ty::Visibility::Public),