Enum rustc_typeck::check::diverges::Diverges [−][src]
pub enum Diverges {
Maybe,
Always {
span: Span,
custom_note: Option<&'static str>,
},
WarnedAlways,
}Expand description
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
Expand description
Potentially unknown, some cases converge, others require a CFG to determine them.
Expand description
Definitely known to diverge and therefore not reach the next sibling or its parent.
Show fields
Fields of Always
span: SpanExpand description
The Span points to the expression
that caused us to diverge
(e.g. return, break, etc).
custom_note: Option<&'static str>Expand description
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.
Expand description
Same as Always but with a reachability
warning already emitted.
Implementations
impl Diverges[src]
impl Diverges[src]Trait Implementations
impl BitAndAssign<Diverges> for Diverges[src]
impl BitAndAssign<Diverges> for Diverges[src]fn bitand_assign(&mut self, other: Self)[src]
fn bitand_assign(&mut self, other: Self)[src]Performs the &= operation. Read more
impl BitOrAssign<Diverges> for Diverges[src]
impl BitOrAssign<Diverges> for Diverges[src]fn bitor_assign(&mut self, other: Self)[src]
fn bitor_assign(&mut self, other: Self)[src]Performs the |= operation. Read more
impl Ord for Diverges[src]
impl Ord for Diverges[src]impl PartialOrd<Diverges> for Diverges[src]
impl PartialOrd<Diverges> for Diverges[src]fn partial_cmp(&self, other: &Diverges) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Diverges) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Diverges[src]
impl Eq for Diverges[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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]
fn with_const(self) -> ConstnessAnd<Self>[src]
fn without_const(self) -> ConstnessAnd<Self>[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,