fix decode logic for 'AttrId' to be symmetric with encode logic

This commit is contained in:
JOE1994 2020-04-19 12:00:45 -04:00
parent 3211b83134
commit 928eedb0aa

View File

@ -2218,8 +2218,8 @@ fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
}
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())
}
}