Struct rustc_mir::transform::coverage::debug::DebugCounters[−][src]

pub(super) struct DebugCounters {
    some_counters: Option<FxHashMap<ExpressionOperandId, DebugCounter>>,
}
Expand description

If enabled, this struct maintains a map from CoverageKind IDs (as ExpressionOperandId) to the CoverageKind data and optional label (normally, the counter’s associated BasicCoverageBlock format string, if any).

Use format_counter to convert one of these CoverageKind counters to a debug output string, as directed by the DebugOptions. This allows the format of counter labels in logs and dump files (including the CoverageGraph graphviz file) to be changed at runtime, via environment variable.

DebugCounters supports a recursive rendering of Expression counters, so they can be presented as nested expressions such as (bcb3 - (bcb0 + bcb1)).

Fields

some_counters: Option<FxHashMap<ExpressionOperandId, DebugCounter>>

Implementations

impl DebugCounters[src]

pub fn new() -> Self[src]

pub fn enable(&mut self)[src]

pub fn is_enabled(&self) -> bool[src]

pub fn add_counter(
    &mut self,
    counter_kind: &CoverageKind,
    some_block_label: Option<String>
)
[src]

pub fn some_block_label(&self, operand: ExpressionOperandId) -> Option<&String>[src]

pub fn format_counter(&self, counter_kind: &CoverageKind) -> String[src]

fn format_counter_kind(&self, counter_kind: &CoverageKind) -> String[src]

fn format_operand(&self, operand: ExpressionOperandId) -> String[src]

Auto Trait Implementations

impl RefUnwindSafe for DebugCounters

impl Send for DebugCounters

impl Sync for DebugCounters

impl Unpin for DebugCounters

impl UnwindSafe for DebugCounters

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> WithConstness for T[src]

fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]

fn with_const(self) -> ConstnessAnd<Self>[src]

fn without_const(self) -> ConstnessAnd<Self>[src]