incr.comp.: Properly use ty::codec::decode_cnum() in rustc_metadata::decoder.
This commit is contained in:
parent
bc96d9d8c9
commit
9ac102645f
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user