Trait rustc_middle::ty::OnDiskCache[−][src]

pub trait OnDiskCache<'tcx>: Sync {
    fn new(sess: &'tcx Session, data: Vec<u8>, start_pos: usize) -> Self
    where
        Self: Sized
;
fn new_empty(source_map: &'tcx SourceMap) -> Self
    where
        Self: Sized
;
fn def_path_hash_to_def_id(
        &self,
        tcx: TyCtxt<'tcx>,
        def_path_hash: DefPathHash
    ) -> Option<DefId>;
fn register_reused_dep_node(&self, tcx: TyCtxt<'tcx>, dep_node: &DepNode);
fn store_foreign_def_id_hash(&self, def_id: DefId, hash: DefPathHash);
fn serialize(
        &self,
        tcx: TyCtxt<'tcx>,
        encoder: &mut FileEncoder
    ) -> FileEncodeResult; }

Required methods

Creates a new OnDiskCache instance from the serialized data in data.

Converts a DefPathHash to its corresponding DefId in the current compilation session, if it still exists. This is used during incremental compilation to turn a deserialized DefPathHash into its current DefId.

If the given dep_node’s hash still exists in the current compilation, and its current DefId is foreign, calls store_foreign_def_id with it.

Normally, store_foreign_def_id_hash can be called directly by the dependency graph when we construct a DepNode. However, when we re-use a deserialized DepNode from the previous compilation session, we only have the DefPathHash available. This method is used to that any DepNode that we re-use has a DefPathHash -> RawId written out for usage in the next compilation session.

Implementors