diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-05-30 17:54:49 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-06-09 20:20:49 +0200 |
| commit | 5be514992fdeddbf56bb44c7baec3ab5e4f79e1b (patch) | |
| tree | c13ec3141a92c4b6928691abe466871690741f6b /compiler/rustc_metadata | |
| parent | 47d38752c65359e1f4558d7a06935982fb8b486f (diff) | |
| download | rust-5be514992fdeddbf56bb44c7baec3ab5e4f79e1b.tar.gz rust-5be514992fdeddbf56bb44c7baec3ab5e4f79e1b.zip | |
Encode CrateNum using the StableCrateId for incr. comp.
Diffstat (limited to 'compiler/rustc_metadata')
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index 52cb1e1996e..48900fecd3e 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -252,6 +252,10 @@ impl<'a, 'tcx> DecodeContext<'a, 'tcx> { self.cdata.expect("missing CrateMetadata in DecodeContext") } + fn map_encoded_cnum_to_current(&self, cnum: CrateNum) -> CrateNum { + if cnum == LOCAL_CRATE { self.cdata().cnum } else { self.cdata().cnum_map[cnum] } + } + fn read_lazy_with_meta<T: ?Sized + LazyMeta>( &mut self, meta: T::Meta, @@ -324,10 +328,6 @@ impl<'a, 'tcx> TyDecoder<'tcx> for DecodeContext<'a, 'tcx> { r } - fn map_encoded_cnum_to_current(&self, cnum: CrateNum) -> CrateNum { - if cnum == LOCAL_CRATE { self.cdata().cnum } else { self.cdata().cnum_map[cnum] } - } - fn decode_alloc_id(&mut self) -> Result<rustc_middle::mir::interpret::AllocId, Self::Error> { if let Some(alloc_decoding_session) = self.alloc_decoding_session { alloc_decoding_session.decode_alloc_id(self) |
