From 928eedb0aaaaf126a726b2197e8bcbe93da95f3c Mon Sep 17 00:00:00 2001 From: JOE1994 Date: Sun, 19 Apr 2020 12:00:45 -0400 Subject: [PATCH] fix decode logic for 'AttrId' to be symmetric with encode logic --- src/librustc_ast/ast.rs | 4 ++-- 1 file 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 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> { } impl rustc_serialize::Decodable for AttrId { - fn decode(_: &mut D) -> Result { - Ok(crate::attr::mk_attr_id()) + fn decode(d: &mut D) -> Result { + d.read_nil().map(|_| crate::attr::mk_attr_id()) } }