Skip to content

Commit 15e71b6

Browse files
committed
Make LazyAttrTokenStream::encode panic.
It's unreachable, because AST JSON printing support was removed some time ago.
1 parent 1b3fba0 commit 15e71b6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_ast/src/tokenstream.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ impl fmt::Debug for LazyAttrTokenStream {
140140
}
141141

142142
impl<S: SpanEncoder> Encodable<S> for LazyAttrTokenStream {
143-
fn encode(&self, s: &mut S) {
144-
// Used by AST json printing.
145-
Encodable::encode(&self.to_attr_token_stream(), s);
143+
fn encode(&self, _s: &mut S) {
144+
panic!("Attempted to encode LazyAttrTokenStream");
146145
}
147146
}
148147

0 commit comments

Comments
 (0)