Skip to main content

Chrec

Struct Chrec 

Source
pub struct Chrec {
    pub base: Invariant,
    pub step: Invariant,
    pub ty: Type,
    pub flags: Flags,
}
Expand description

An affine chain of recurrences, {base, +, step}, evolving in a named type.

The type is not decoration. {0, +, 1} in unsigned char is not the sequence 0, 1, 2, ..., it is that sequence modulo two hundred and fifty six, and section 7.7 says this is where a naive implementation is wrong constantly and in ways that pass every test written by someone thinking in int. Every operation here checks the type and every one that cannot stay right in it answers unknown.

Fields§

§base: Invariant

What the value is on the first iteration.

§step: Invariant

What is added each time round.

§ty: Type

The type it evolves in, which is what says when it wraps.

§flags: Flags

What the instruction that increments it promised. nsw means the sequence does not wrap when read as signed and nuw means it does not when read as unsigned, and both come from the increment rather than from anything this analysis proved.

Implementations§

Source§

impl Chrec

Source

pub fn does_not_wrap(self, signed: bool) -> bool

Whether the sequence is known not to wrap under the reading this predicate takes.

Trait Implementations§

Source§

impl Clone for Chrec

Source§

fn clone(&self) -> Chrec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Chrec

Source§

impl Debug for Chrec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Chrec

Source§

impl PartialEq for Chrec

Source§

fn eq(&self, other: &Chrec) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Chrec

Auto Trait Implementations§

§

impl Freeze for Chrec

§

impl RefUnwindSafe for Chrec

§

impl Send for Chrec

§

impl Sync for Chrec

§

impl Unpin for Chrec

§

impl UnsafeUnpin for Chrec

§

impl UnwindSafe for Chrec

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.