Skip to content

Commit 928eedb

Browse files
committed
fix decode logic for 'AttrId' to be symmetric with encode logic
1 parent 3211b83 commit 928eedb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_ast/ast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2218,8 +2218,8 @@ impl rustc_serialize::Encodable for AttrId {
22182218
}
22192219

22202220
impl rustc_serialize::Decodable for AttrId {
2221-
fn decode<D: Decoder>(_: &mut D) -> Result<AttrId, D::Error> {
2222-
Ok(crate::attr::mk_attr_id())
2221+
fn decode<D: Decoder>(d: &mut D) -> Result<AttrId, D::Error> {
2222+
d.read_nil().map(|_| crate::attr::mk_attr_id())
22232223
}
22242224
}
22252225

0 commit comments

Comments
 (0)