pub struct DefPathToIndexMap {
pub before_parallel_alloc: DefPathHashMap,
pub after_parallel_alloc: Option<SortedMap<Hash64, DefIndex>>,
}Fields§
§before_parallel_alloc: DefPathHashMapStores mapping from local hash to def indices which are allocated when the order
of their allocation is deterministic (see where commit_end_of_determinism is called,
at the moment of writing it is after prefetch of hir_crate_items in run_required_analysis).
after_parallel_alloc: Option<SortedMap<Hash64, DefIndex>>Stores the same mapping as previous map but is used after the allocation order of def indices
is not deterministic, so when serializing metadata we have a ready to use sorted by stable local
hash (which does not change between compiler invocations) mapping. We use it for relatively small number
of definitions, so the majority of them would be stored in DefPathHashMap, which makes insertion
and serialization costs of SortedMap acceptable.
Implementations§
Source§impl DefPathToIndexMap
impl DefPathToIndexMap
pub fn get(&self, hash: Hash64) -> Option<DefIndex>
Sourcepub fn insert(&mut self, hash: Hash64, index: DefIndex) -> Option<DefIndex>
pub fn insert(&mut self, hash: Hash64, index: DefIndex) -> Option<DefIndex>
This insert function does not behave like regular insert of a HashMap,
as the return value is used only for printing information about existing
def index for local hash before panicking. So we can do not actually insert
def index into det_part when we are in non-deterministic mode.
Trait Implementations§
Source§impl Debug for DefPathToIndexMap
impl Debug for DefPathToIndexMap
Auto Trait Implementations§
impl DynSend for DefPathToIndexMap
impl DynSync for DefPathToIndexMap
impl Freeze for DefPathToIndexMap
impl RefUnwindSafe for DefPathToIndexMap
impl Send for DefPathToIndexMap
impl Sync for DefPathToIndexMap
impl Unpin for DefPathToIndexMap
impl UnsafeUnpin for DefPathToIndexMap
impl UnwindSafe for DefPathToIndexMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes