[−][src]Enum rustc_typeck::check::diverges::Diverges
Tracks whether executing a node may exit normally (versus return/break/panic, which "diverge", leaving dead code in their wake). Tracked semi-automatically (through type variables marked as diverging), with some manual adjustments for control-flow primitives (approximating a CFG).
Variants
Potentially unknown, some cases converge, others require a CFG to determine them.
Definitely known to diverge and therefore not reach the next sibling or its parent.
Fields of Always
span: SpanThe Span points to the expression
that caused us to diverge
(e.g. return, break, etc).
custom_note: Option<&'static str>In some cases (e.g. a match expression
where all arms diverge), we may be
able to provide a more informative
message to the user.
If this is None, a default message
will be generated, which is suitable
for most cases.
Same as Always but with a reachability
warning already emitted.
Implementations
impl Diverges[src]
pub(in check) fn always(
span: Span
) -> Diverges[src]
span: Span
) -> Diverges
Creates a Diverges::Always with the provided span and the default note message.
pub(in check) fn is_always(
self
) -> bool[src]
self
) -> bool
Trait Implementations
impl BitAnd<Diverges> for Diverges[src]
type Output = Self
The resulting type after applying the & operator.
pub fn bitand(self, other: Self) -> Self[src]
impl BitAndAssign<Diverges> for Diverges[src]
pub fn bitand_assign(&mut self, other: Self)[src]
impl BitOr<Diverges> for Diverges[src]
type Output = Self
The resulting type after applying the | operator.
pub fn bitor(self, other: Self) -> Self[src]
impl BitOrAssign<Diverges> for Diverges[src]
pub fn bitor_assign(&mut self, other: Self)[src]
impl Clone for Diverges[src]
impl Copy for Diverges[src]
impl Debug for Diverges[src]
impl Eq for Diverges[src]
impl Ord for Diverges[src]
pub fn cmp(&self, other: &Diverges) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self[src]
impl PartialEq<Diverges> for Diverges[src]
impl PartialOrd<Diverges> for Diverges[src]
pub fn partial_cmp(&self, other: &Diverges) -> Option<Ordering>[src]
pub fn lt(&self, other: &Diverges) -> bool[src]
pub fn le(&self, other: &Diverges) -> bool[src]
pub fn gt(&self, other: &Diverges) -> bool[src]
pub fn ge(&self, other: &Diverges) -> bool[src]
impl StructuralEq for Diverges[src]
impl StructuralPartialEq for Diverges[src]
Auto Trait Implementations
impl RefUnwindSafe for Diverges
impl !Send for Diverges
impl !Sync for Diverges
impl Unpin for Diverges
impl UnwindSafe for Diverges
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.