From 6b63e9b990b1624df3f93aeca849a33efcf156e9 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 31 Oct 2020 22:47:57 +0300 Subject: Do not remove tokens before AST json serialization --- compiler/rustc_ast/src/tokenstream.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_ast/src/tokenstream.rs') diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs index b53acb97aeb..98da20af8f6 100644 --- a/compiler/rustc_ast/src/tokenstream.rs +++ b/compiler/rustc_ast/src/tokenstream.rs @@ -153,8 +153,9 @@ impl fmt::Debug for LazyTokenStream { } impl Encodable for LazyTokenStream { - fn encode(&self, _s: &mut S) -> Result<(), S::Error> { - panic!("Attempted to encode LazyTokenStream"); + fn encode(&self, s: &mut S) -> Result<(), S::Error> { + // Used by AST json printing. + Encodable::encode(&self.create_token_stream(), s) } } -- cgit 1.4.1-3-g733a5