pub struct LowerStats {
pub lowered: u32,
pub skipped: HashMap<SkipReason, u32>,
}Expand description
Coverage counters for a single lower_program call.
lowered = fns successfully placed into MirProgram.fns.
skipped = fns dropped, keyed by the first SkipReason the
lowerer hit inside that fn. Total = lowered + skipped.values().sum()
equals the number of ResolvedFnDef items the call saw.
Fields§
§lowered: u32Number of fns whose body lowered successfully into
MirProgram.fns.
skipped: HashMap<SkipReason, u32>Skipped fns keyed by reason. One bump per dropped fn.
Implementations§
Source§impl LowerStats
impl LowerStats
Sourcepub fn coverage_ratio(&self) -> f64
pub fn coverage_ratio(&self) -> f64
Coverage ratio in [0.0, 1.0]. Returns 1.0 for an empty
program so empty corpora don’t poison the gate.
Sourcepub fn record_lowered(&mut self)
pub fn record_lowered(&mut self)
Record one lowered fn.
Sourcepub fn record_skip(&mut self, reason: SkipReason)
pub fn record_skip(&mut self, reason: SkipReason)
Record one dropped fn with its dominant reason.
Sourcepub fn skipped_sorted(&self) -> Vec<(SkipReason, u32)>
pub fn skipped_sorted(&self) -> Vec<(SkipReason, u32)>
Iterate (SkipReason, count) pairs in a stable order
(variant order via SkipReason as u8 ascending), so dumps
- test assertions don’t depend on
HashMapiteration drift.
Trait Implementations§
Source§impl Clone for LowerStats
impl Clone for LowerStats
Source§fn clone(&self) -> LowerStats
fn clone(&self) -> LowerStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LowerStats
impl Debug for LowerStats
Source§impl Default for LowerStats
impl Default for LowerStats
Source§fn default() -> LowerStats
fn default() -> LowerStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LowerStats
impl RefUnwindSafe for LowerStats
impl Send for LowerStats
impl Sync for LowerStats
impl Unpin for LowerStats
impl UnsafeUnpin for LowerStats
impl UnwindSafe for LowerStats
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
Mutably borrows from an owned value. Read more