Expand description
Readers and writers for the intermediate artifacts we store per crate.
Most of this code is adapted/copied from EncodeContext
and DecodeContext
in rustc_metadata
.
We use a lot of min_specialization
here to change how DefId
s, Span
s
and such are encoded since their default implementations are panics.
Specifically for CrateNum
(e.g. DefId
also), we use stable crate hashes.
These appear to work fine, however I am not sure they are guaranteed to be
stable across different crates. Rustc itself uses an explicit remapping
replying on CrateMetadataRef
, which we can construct but not use (relevant
functions are hidden).
Note that we encode AllocId
s simply as themselves. This is possibly
incorrect but weβre not really relying on this information at the moment so
we are not investing in it.
MacrosΒ§
- decoder_
methods π - encoder_
methods π
StructsΒ§
- Something that implements
TyDecoder
. - A structure that implements
TyEncoder
for us.
ConstantsΒ§
- CLEAR_
CROSS_ πCRATE Whatever canβt survive the crossing we need to live without. - TAG_
ENCODE_ πLOCAL - TAG_
ENCODE_ πREMOTE - TAG_
PARTIAL_ πSPAN - TAG_
VALID_ πSPAN_ FULL
FunctionsΒ§
- Convenience function that decodes a value from a file.
- Convenience function that encodes some value to a file.
- path_
in_ πreal_ path Which path in aRealFileName
do we care about?