rustc_mir_dataflow::fmt

Trait DebugWithContext

Source
pub trait DebugWithContext<C>: Eq + Debug {
    // Provided methods
    fn fmt_with(&self, _ctxt: &C, f: &mut Formatter<'_>) -> Result { ... }
    fn fmt_diff_with(
        &self,
        old: &Self,
        ctxt: &C,
        f: &mut Formatter<'_>,
    ) -> Result { ... }
}
Expand description

An extension to fmt::Debug for data that can be better printed with some auxiliary data C.

Provided Methods§

Source

fn fmt_with(&self, _ctxt: &C, f: &mut Formatter<'_>) -> Result

Source

fn fmt_diff_with(&self, old: &Self, ctxt: &C, f: &mut Formatter<'_>) -> Result

Print the difference between self and old.

This should print nothing if self == old.

+ and - are typically used to indicate differences. However, these characters are fairly common and may be needed to print a types representation. If using them to indicate a diff, prefix them with the “Unit Separator” control character (␟ U+001F).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<C> DebugWithContext<C> for Local

Source§

impl<T, C> DebugWithContext<C> for &T
where T: DebugWithContext<C>,

Source§

fn fmt_with(&self, ctxt: &C, f: &mut Formatter<'_>) -> Result

Source§

fn fmt_diff_with(&self, old: &Self, ctxt: &C, f: &mut Formatter<'_>) -> Result

Source§

impl<T, C> DebugWithContext<C> for BitSet<T>
where T: Idx + DebugWithContext<C>,

Source§

fn fmt_with(&self, ctxt: &C, f: &mut Formatter<'_>) -> Result

Source§

fn fmt_diff_with(&self, old: &Self, ctxt: &C, f: &mut Formatter<'_>) -> Result

Source§

impl<T, C> DebugWithContext<C> for ChunkedBitSet<T>
where T: Idx + DebugWithContext<C>,

Source§

fn fmt_with(&self, ctxt: &C, f: &mut Formatter<'_>) -> Result

Source§

fn fmt_diff_with(&self, old: &Self, ctxt: &C, f: &mut Formatter<'_>) -> Result

Implementors§

Source§

impl<'tcx, C> DebugWithContext<C> for MovePathIndex
where C: HasMoveData<'tcx>,

Source§

impl<C> DebugWithContext<C> for InitIndex

Source§

impl<S, C> DebugWithContext<C> for MaybeReachable<S>
where S: DebugWithContext<C>,

Source§

impl<T, C> DebugWithContext<C> for Dual<T>
where T: DebugWithContext<C>,