Enum rustc_middle::mir::AssertKind
source · [−]pub enum AssertKind<O> {
BoundsCheck {
len: O,
index: O,
},
Overflow(BinOp, O, O),
OverflowNeg(O),
DivisionByZero(O),
RemainderByZero(O),
ResumedAfterReturn(GeneratorKind),
ResumedAfterPanic(GeneratorKind),
}
Expand description
Information about an assertion failure.
Variants
BoundsCheck
Overflow(BinOp, O, O)
OverflowNeg(O)
DivisionByZero(O)
RemainderByZero(O)
ResumedAfterReturn(GeneratorKind)
ResumedAfterPanic(GeneratorKind)
Implementations
sourceimpl<O> AssertKind<O>
impl<O> AssertKind<O>
sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Getting a description does not require O
to be printable, and does not
require allocation.
The caller is expected to handle BoundsCheck
separately.
Trait Implementations
sourceimpl<O: Clone> Clone for AssertKind<O>
impl<O: Clone> Clone for AssertKind<O>
sourcefn clone(&self) -> AssertKind<O>
fn clone(&self) -> AssertKind<O>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<O: Debug> Debug for AssertKind<O>
impl<O: Debug> Debug for AssertKind<O>
sourceimpl<'tcx, O, __D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<__D> for AssertKind<O> where
O: Decodable<__D>,
impl<'tcx, O, __D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<__D> for AssertKind<O> where
O: Decodable<__D>,
sourceimpl<'tcx, O, __E: TyEncoder<I = TyCtxt<'tcx>>> Encodable<__E> for AssertKind<O> where
O: Encodable<__E>,
impl<'tcx, O, __E: TyEncoder<I = TyCtxt<'tcx>>> Encodable<__E> for AssertKind<O> where
O: Encodable<__E>,
sourceimpl<O: Hash> Hash for AssertKind<O>
impl<O: Hash> Hash for AssertKind<O>
sourceimpl<'__ctx, O> HashStable<StableHashingContext<'__ctx>> for AssertKind<O> where
O: HashStable<StableHashingContext<'__ctx>>,
impl<'__ctx, O> HashStable<StableHashingContext<'__ctx>> for AssertKind<O> where
O: HashStable<StableHashingContext<'__ctx>>,
fn hash_stable(
&self,
__hcx: &mut StableHashingContext<'__ctx>,
__hasher: &mut StableHasher
)
sourceimpl<O: PartialEq> PartialEq<AssertKind<O>> for AssertKind<O>
impl<O: PartialEq> PartialEq<AssertKind<O>> for AssertKind<O>
sourcefn eq(&self, other: &AssertKind<O>) -> bool
fn eq(&self, other: &AssertKind<O>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AssertKind<O>) -> bool
fn ne(&self, other: &AssertKind<O>) -> bool
This method tests for !=
.
sourceimpl<O: PartialOrd> PartialOrd<AssertKind<O>> for AssertKind<O>
impl<O: PartialOrd> PartialOrd<AssertKind<O>> for AssertKind<O>
sourcefn partial_cmp(&self, other: &AssertKind<O>) -> Option<Ordering>
fn partial_cmp(&self, other: &AssertKind<O>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<O> StructuralPartialEq for AssertKind<O>
Auto Trait Implementations
impl<O> RefUnwindSafe for AssertKind<O> where
O: RefUnwindSafe,
impl<O> Send for AssertKind<O> where
O: Send,
impl<O> Sync for AssertKind<O> where
O: Sync,
impl<O> Unpin for AssertKind<O> where
O: Unpin,
impl<O> UnwindSafe for AssertKind<O> where
O: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
default fn fingerprint_style() -> FingerprintStyle
sourcedefault fn to_fingerprint(&self, tcx: Ctxt) -> Fingerprint
default fn to_fingerprint(&self, tcx: Ctxt) -> Fingerprint
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more
default fn to_debug_str(&self, Ctxt) -> String
sourcedefault fn recover(Ctxt, &DepNode<<Ctxt as DepContext>::DepKind>) -> Option<T>
default fn recover(Ctxt, &DepNode<<Ctxt as DepContext>::DepKind>) -> Option<T>
This method tries to recover the query key from the given DepNode
,
something which is needed when forcing DepNode
s during red-green
evaluation. The query system will only call this method if
fingerprint_style()
is not FingerprintStyle::Opaque
.
It is always valid to return None
here, in which case incremental
compilation will treat the query as having changed instead of forcing it. Read more
sourceimpl<T, R> InternIteratorElement<T, R> for T
impl<T, R> InternIteratorElement<T, R> for T
type Output = R
fn intern_with<I, F>(
iter: I,
f: F
) -> <T as InternIteratorElement<T, R>>::Output where
I: Iterator<Item = T>,
F: FnOnce(&[T]) -> R,
sourceimpl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
impl<'a, T> Captures<'a> for T where
T: ?Sized,
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.