about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJOE1994 <joseph942010@gmail.com>2020-04-19 12:00:45 -0400
committerJOE1994 <joseph942010@gmail.com>2020-04-19 12:00:45 -0400
commit928eedb0aaaaf126a726b2197e8bcbe93da95f3c (patch)
tree4ec5e4c2fee46b70f0b7ba40db9caa1ff2167b1e /src
parent3211b8313407e1a1b4d6bac847156f32008e732f (diff)
downloadrust-928eedb0aaaaf126a726b2197e8bcbe93da95f3c.tar.gz
rust-928eedb0aaaaf126a726b2197e8bcbe93da95f3c.zip
fix decode logic for 'AttrId' to be symmetric with encode logic
Diffstat (limited to 'src')
-rw-r--r--src/librustc_ast/ast.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_ast/ast.rs b/src/librustc_ast/ast.rs
index ffee454dbac..f58a0c6deae 100644
--- a/src/librustc_ast/ast.rs
+++ b/src/librustc_ast/ast.rs
@@ -2218,8 +2218,8 @@ impl rustc_serialize::Encodable for AttrId {
 }
 
 impl rustc_serialize::Decodable for AttrId {
-    fn decode<D: Decoder>(_: &mut D) -> Result<AttrId, D::Error> {
-        Ok(crate::attr::mk_attr_id())
+    fn decode<D: Decoder>(d: &mut D) -> Result<AttrId, D::Error> {
+        d.read_nil().map(|_| crate::attr::mk_attr_id())
     }
 }