Enum rustc_hir_typeck::diverges::Diverges
source · 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§
Maybe
Potentially unknown, some cases converge, others require a CFG to determine them.
Always
Fields
Definitely known to diverge and therefore not reach the next sibling or its parent.
WarnedAlways
Same as Always
but with a reachability
warning already emitted.
Implementations§
Trait Implementations§
source§impl BitAndAssign<Diverges> for Diverges
impl BitAndAssign<Diverges> for Diverges
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
&=
operation. Read moresource§impl BitOrAssign<Diverges> for Diverges
impl BitOrAssign<Diverges> for Diverges
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|=
operation. Read moresource§impl Ord for Diverges
impl Ord for Diverges
source§impl PartialEq<Diverges> for Diverges
impl PartialEq<Diverges> for Diverges
source§impl PartialOrd<Diverges> for Diverges
impl PartialOrd<Diverges> for Diverges
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Diverges
impl Eq for Diverges
impl StructuralEq for Diverges
impl StructuralPartialEq for Diverges
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§
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes
Size for each variant:
Maybe
: 0 bytesAlways
: 28 bytesWarnedAlways
: 0 bytes