pub(crate) struct DedupHashEncoder(pub(crate) StableHasher);Expand description
Hasher used to determine if two diagnostics are the same and should be deduplicated. Used by
DiagCtxtInner::emitted_diagnostics. It’s a stable hash with one special behaviour: parents of
spans within the diagnostics are ignored so that incremental and non-incremental compilation
get the same behaviour.
Although this has nothing to do with encoding data to/from file, it is implemented on top of
Encoder/SpanEncoder because they provide traversals of all the relevant types used within
diagnostics. There is no corresponding decoder.
Tuple Fields§
§0: StableHasherTrait Implementations§
Source§impl Encoder for DedupHashEncoder
impl Encoder for DedupHashEncoder
fn emit_usize(&mut self, value: usize)
fn emit_u128(&mut self, value: u128)
fn emit_u64(&mut self, value: u64)
fn emit_u32(&mut self, value: u32)
fn emit_u16(&mut self, value: u16)
fn emit_u8(&mut self, value: u8)
fn emit_isize(&mut self, value: isize)
fn emit_i128(&mut self, value: i128)
fn emit_i64(&mut self, value: i64)
fn emit_i32(&mut self, value: i32)
fn emit_i16(&mut self, value: i16)
fn emit_raw_bytes(&mut self, value: &[u8])
fn emit_i8(&mut self, v: i8)
fn emit_bool(&mut self, v: bool)
fn emit_char(&mut self, v: char)
fn emit_str(&mut self, v: &str)
fn emit_byte_str(&mut self, v: &[u8])
Source§impl SpanEncoder for DedupHashEncoder
impl SpanEncoder for DedupHashEncoder
fn encode_span(&mut self, span: Span)
fn encode_symbol(&mut self, value: Symbol)
fn encode_byte_symbol(&mut self, value: ByteSymbol)
fn encode_expn_id(&mut self, value: ExpnId)
fn encode_syntax_context(&mut self, value: SyntaxContext)
Source§fn encode_crate_num(&mut self, value: CrateNum)
fn encode_crate_num(&mut self, value: CrateNum)
CrateNum is only meaningful within its context, e.g. within a
tcx. Therefore, make sure to include the context when encode a CrateNum.fn encode_def_index(&mut self, value: DefIndex)
fn encode_def_id(&mut self, value: DefId)
fn encode_local_def_id(&mut self, def_id: LocalDefId)
fn encode_def_key(
&mut self,
parent: Option<DefIndex>,
disambiguated_data: impl Encodable<Self>,
)where
Self: Sized,
Auto Trait Implementations§
impl DynSend for DedupHashEncoder
impl DynSync for DedupHashEncoder
impl Freeze for DedupHashEncoder
impl RefUnwindSafe for DedupHashEncoder
impl Send for DedupHashEncoder
impl Sync for DedupHashEncoder
impl Unpin for DedupHashEncoder
impl UnsafeUnpin for DedupHashEncoder
impl UnwindSafe for DedupHashEncoder
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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: 120 bytes