From 15e71b6e43e28ffaa9db70c39fdf82be062e5cfd Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 24 Apr 2024 10:46:43 +1000 Subject: [PATCH] Make `LazyAttrTokenStream::encode` panic. It's unreachable, because AST JSON printing support was removed some time ago. --- compiler/rustc_ast/src/tokenstream.rs | 5 ++--- 1 file 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 Encodable 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"); } }