about summary refs log tree commit diff
path: root/compiler/rustc_ast/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-11-02 10:42:45 +0000
committerbors <bors@rust-lang.org>2020-11-02 10:42:45 +0000
commit4051473c8b5158984a5253d1b5faad6a94de7682 (patch)
treea3dcca4b2e5d8b9a5b0a3d058010826b5901d30f /compiler/rustc_ast/src
parent234099d1d12bef9d6e81a296222fbc272dc51d89 (diff)
parent50d7716efb7cffb43a0ca77c723754ad2174e9cc (diff)
downloadrust-4051473c8b5158984a5253d1b5faad6a94de7682.tar.gz
rust-4051473c8b5158984a5253d1b5faad6a94de7682.zip
Auto merge of #78661 - JohnTitor:rollup-er2isja, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #78606 (Clarify handling of final line ending in str::lines())
 - #78610 (Do not remove tokens before AST json serialization)
 - #78620 (Trivial fixes to bitwise operator documentation)
 - #78627 (Point out that total_cmp is no strict superset of partial comparison)
 - #78637 (Add fetch_update methods to AtomicBool and AtomicPtr)

Failed merges:

r? `@ghost`
Diffstat (limited to 'compiler/rustc_ast/src')
-rw-r--r--compiler/rustc_ast/src/tokenstream.rs5
1 files changed, 3 insertions, 2 deletions
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<S: Encoder> Encodable<S> 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)
     }
 }