[−][src]Struct rustc_mir::transform::coverage::counters::CoverageCounters

pub(in transform::coverage) struct CoverageCounters {
    function_source_hash: u64,
    next_counter_id: u32,
    num_expressions: u32,
    pub debug_counters: DebugCounters,
}

Manages the counter and expression indexes/IDs to generate CoverageKind components for MIR Coverage statements.

Fields

function_source_hash: u64next_counter_id: u32num_expressions: u32debug_counters: DebugCounters

Implementations

impl CoverageCounters[src]

pub fn new(function_source_hash: u64) -> Self[src]

pub fn enable_debug(&mut self)[src]

Activate the DebugCounters data structures, to provide additional debug formatting features when formating CoverageKind (counter) values.

pub fn make_bcb_counters(
    &mut self,
    basic_coverage_blocks: &mut CoverageGraph,
    coverage_spans: &Vec<CoverageSpan>
) -> Result<Vec<CoverageKind>, Error>
[src]

Makes CoverageKind Counters and Expressions for the BasicCoverageBlocks directly or indirectly associated with CoverageSpans, and returns additional Expressions representing intermediate values.

pub(in transform::coverage::counters) fn make_counter<F>(
    &mut self,
    debug_block_label_fn: F
) -> CoverageKind where
    F: Fn() -> Option<String>, 
[src]

pub(in transform::coverage::counters) fn make_expression<F>(
    &mut self,
    lhs: ExpressionOperandId,
    op: Op,
    rhs: ExpressionOperandId,
    debug_block_label_fn: F
) -> CoverageKind where
    F: Fn() -> Option<String>, 
[src]

pub fn make_identity_counter(
    &mut self,
    counter_operand: ExpressionOperandId
) -> CoverageKind
[src]

pub(in transform::coverage::counters) fn next_counter(
    &mut self
) -> CounterValueReference
[src]

Counter IDs start from one and go up.

pub(in transform::coverage::counters) fn next_expression(
    &mut self
) -> InjectedExpressionId
[src]

Expression IDs start from u32::MAX and go down because a Expression can reference (add or subtract counts) of both Counter regions and Expression regions. The counter expression operand IDs must be unique across both types.

Auto Trait Implementations

impl RefUnwindSafe for CoverageCounters

impl Send for CoverageCounters

impl Sync for CoverageCounters

impl Unpin for CoverageCounters

impl UnwindSafe for CoverageCounters

Blanket Implementations

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

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

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

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

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

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.

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.

impl<T> WithConstness for T[src]