Skip to main content

Preserved

Struct Preserved 

Source
pub struct Preserved(/* private fields */);
Expand description

What a pass leaves standing.

A set rather than the three cases the design writes, because Preserved::ALL and Preserved::NONE are the full set and the empty one and a named set is what is between them. A pass that adds an analysis to this list is saying the code it produced answers the same questions the code it was given did, which is a claim about a pass and not about a run, so it is stated once on the pass rather than returned from each call.

Implementations§

Source§

impl Preserved

Source

pub const ALL: Preserved

Everything, which is what a pass that does not change the shape of a function says.

Source

pub const NONE: Preserved

Nothing, which is what a pass that moves an edge says, however small the move was.

Source

pub const fn and(self, analysis: Analysis) -> Self

This set and that analysis.

Source

pub const fn without(self, analysis: Analysis) -> Self

This set without that analysis.

The way a pass says “everything except one thing”, which is what a pass that rewrites operands and moves no edge has to say: the shape of the function is what it was and the liveness is not, because a value read in one more place is live in one more place.

Source

pub const fn keeps(self, analysis: Analysis) -> bool

Whether the pass said this one survived.

Trait Implementations§

Source§

impl Clone for Preserved

Source§

fn clone(&self) -> Preserved

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 Preserved

Source§

impl Debug for Preserved

Source§

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

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

impl Eq for Preserved

Source§

impl PartialEq for Preserved

Source§

fn eq(&self, other: &Preserved) -> 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 Preserved

Auto Trait Implementations§

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.