From 9ac102645fd6413ae460b34ec4c06eec25979355 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Mon, 13 Nov 2017 15:48:52 +0100 Subject: [PATCH] incr.comp.: Properly use ty::codec::decode_cnum() in rustc_metadata::decoder. --- src/librustc_metadata/decoder.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 5fee7173c87..83d0a1fdfdb 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -295,12 +295,7 @@ impl<'a, 'tcx, T> SpecializedDecoder> for DecodeContext<'a, 'tcx> { impl<'a, 'tcx> SpecializedDecoder for DecodeContext<'a, 'tcx> { fn specialized_decode(&mut self) -> Result { - 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) } }