about summary refs log tree commit diff
path: root/compiler/rustc_ast/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-04-24 10:46:43 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-04-24 16:28:34 +1000
commit15e71b6e43e28ffaa9db70c39fdf82be062e5cfd (patch)
tree89c2f04f399283851d1bf2f644d2dd70464ed186 /compiler/rustc_ast/src
parent1b3fba066c21e7c3471fca710783fc1e6546a1ca (diff)
downloadrust-15e71b6e43e28ffaa9db70c39fdf82be062e5cfd.tar.gz
rust-15e71b6e43e28ffaa9db70c39fdf82be062e5cfd.zip
Make `LazyAttrTokenStream::encode` panic.
It's unreachable, because AST JSON printing support was removed some
time ago.
Diffstat (limited to 'compiler/rustc_ast/src')
-rw-r--r--compiler/rustc_ast/src/tokenstream.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs
index 880f92bbe7b..08d65a5ffa5 100644
--- a/compiler/rustc_ast/src/tokenstream.rs
+++ b/compiler/rustc_ast/src/tokenstream.rs
@@ -140,9 +140,8 @@ impl fmt::Debug for LazyAttrTokenStream {
 }
 
 impl<S: SpanEncoder> Encodable<S> for LazyAttrTokenStream {
-    fn encode(&self, s: &mut S) {
-        // Used by AST json printing.
-        Encodable::encode(&self.to_attr_token_stream(), s);
+    fn encode(&self, _s: &mut S) {
+        panic!("Attempted to encode LazyAttrTokenStream");
     }
 }