From fdf8543cf61103e56cd86eadd845a65f12eaad54 Mon Sep 17 00:00:00 2001 From: John Clements Date: Wed, 13 Mar 2013 10:52:45 -0700 Subject: [PATCH] add nonempty encoding for spans Before this change, encoding an object containing a codemap::span using the JSON encodeng produced invalid JSON, for instance: [{"span":,"global":false,"idents":["abc"]}] Since the decoder for codemap::span's ignores its argument, I conjecture that this will not damage decoding, and should improve it for many decoders. --- src/libsyntax/codemap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 0d6ece8ad92f..97719a140a6a 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -140,7 +140,7 @@ impl cmp::Eq for span { impl Encodable for span { /* Note #1972 -- spans are encoded but not decoded */ - fn encode(&self, _s: &S) { } + fn encode(&self, _s: &S) { _s.emit_nil() } } impl Decodable for span {