incr.comp.: Properly use ty::codec::decode_cnum() in rustc_metadata::decoder.

This commit is contained in:
Michael Woerister 2017-11-13 15:48:52 +01:00
parent bc96d9d8c9
commit 9ac102645f

View File

@ -295,12 +295,7 @@ impl<'a, 'tcx, T> SpecializedDecoder<LazySeq<T>> for DecodeContext<'a, 'tcx> {
impl<'a, 'tcx> SpecializedDecoder<CrateNum> for DecodeContext<'a, 'tcx> {
fn specialized_decode(&mut self) -> Result<CrateNum, Self::Error> {
let cnum = CrateNum::from_u32(u32::decode(self)?);
if cnum == LOCAL_CRATE {
Ok(self.cdata().cnum)
} else {
Ok(self.cdata().cnum_map.borrow()[cnum])
}
ty_codec::decode_cnum(self)
}
}