[−][src]Enum rustc_mir_build::thir::pattern::usefulness::Usefulness
Variants
Useful(SpanSet)Pontentially carries a set of sub-branches that have been found to be unreachable. Used only in the presence of or-patterns, otherwise it stays empty.
Carries a list of witnesses of non-exhaustiveness.
Implementations
impl<'tcx> Usefulness<'tcx>[src]
fn new_useful(preference: WitnessPreference) -> Self[src]
fn merge(usefulnesses: impl Iterator<Item = Self>) -> Self[src]
When trying several branches and each returns a Usefulness, we need to combine the
results together.
fn unsplit_or_pat(self, this_span: Span, or_pat_spans: &[Span]) -> Self[src]
After calculating the usefulness for a branch of an or-pattern, call this to make this usefulness mergeable with those from the other branches.
fn apply_constructor<'p>(
self,
pcx: PatCtxt<'_, 'p, 'tcx>,
matrix: &Matrix<'p, 'tcx>,
ctor: &Constructor<'tcx>,
ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> Self[src]
self,
pcx: PatCtxt<'_, 'p, 'tcx>,
matrix: &Matrix<'p, 'tcx>,
ctor: &Constructor<'tcx>,
ctor_wild_subpatterns: &Fields<'p, 'tcx>
) -> Self
After calculating usefulness after a specialization, call this to recontruct a usefulness that makes sense for the matrix pre-specialization. This new usefulness can then be merged with the results of specializing with the other constructors.
Trait Implementations
impl<'tcx> Clone for Usefulness<'tcx>[src]
pub fn clone(&self) -> Usefulness<'tcx>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'tcx> Debug for Usefulness<'tcx>[src]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for Usefulness<'tcx>[src]
impl<'tcx> !Send for Usefulness<'tcx>[src]
impl<'tcx> !Sync for Usefulness<'tcx>[src]
impl<'tcx> Unpin for Usefulness<'tcx>[src]
impl<'tcx> !UnwindSafe for Usefulness<'tcx>[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,