pub struct UsefulnessReport<'p, Cx: PatCx> {
pub arm_usefulness: Vec<(MatchArm<'p, Cx>, Usefulness<'p, Cx>)>,
pub non_exhaustiveness_witnesses: Vec<WitnessPat<Cx>>,
pub arm_intersections: Vec<BitSet<usize>>,
}
Expand description
The output of checking a match for exhaustiveness and arm usefulness.
Fields§
§arm_usefulness: Vec<(MatchArm<'p, Cx>, Usefulness<'p, Cx>)>
For each arm of the input, whether that arm is useful after the arms above it.
non_exhaustiveness_witnesses: Vec<WitnessPat<Cx>>
If the match is exhaustive, this is empty. If not, this contains witnesses for the lack of exhaustiveness.
arm_intersections: Vec<BitSet<usize>>
For each arm, a set of indices of arms above it that have non-empty intersection, i.e. there is a value matched by both arms. This may miss real intersections.
Auto Trait Implementations§
impl<'p, Cx> Freeze for UsefulnessReport<'p, Cx>
impl<'p, Cx> RefUnwindSafe for UsefulnessReport<'p, Cx>where
<Cx as PatCx>::Ty: RefUnwindSafe,
<Cx as PatCx>::ArmData: RefUnwindSafe,
<Cx as PatCx>::VariantIdx: RefUnwindSafe,
<Cx as PatCx>::StrLit: RefUnwindSafe,
<Cx as PatCx>::PatData: RefUnwindSafe,
impl<'p, Cx> Send for UsefulnessReport<'p, Cx>
impl<'p, Cx> Sync for UsefulnessReport<'p, Cx>
impl<'p, Cx> Unpin for UsefulnessReport<'p, Cx>
impl<'p, Cx> UnwindSafe for UsefulnessReport<'p, Cx>where
<Cx as PatCx>::Ty: UnwindSafe + RefUnwindSafe,
<Cx as PatCx>::ArmData: UnwindSafe,
<Cx as PatCx>::VariantIdx: UnwindSafe + RefUnwindSafe,
<Cx as PatCx>::StrLit: UnwindSafe + RefUnwindSafe,
<Cx as PatCx>::PatData: RefUnwindSafe,
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