RelevantPlaces

Struct RelevantPlaces 

Source
pub struct RelevantPlaces {
    pub places: FxHashSet<PlaceKey>,
    pub locals: FxHashSet<Local>,
}
Expand description

Set of places that make MIR items relevant to a property.

Fields§

§places: FxHashSet<PlaceKey>

Contract-level places, including callee arguments before binding.

§locals: FxHashSet<Local>

MIR locals that are already known from local contract places.

Implementations§

Source§

impl RelevantPlaces

Source

pub fn new() -> Self

Create an empty relevance set.

Source

pub fn from_property(property: &Property<'_>) -> Self

Extract initial relevance roots from a required property.

Source

pub fn is_empty(&self) -> bool

Return true when no roots have been collected.

Source

pub fn place_count(&self) -> usize

Return the number of contract-level places in this set.

Source

pub fn local_count(&self) -> usize

Return the number of MIR locals in this set.

Source

pub fn insert_local(&mut self, local: Local)

Insert a MIR local as a relevance root.

Source

pub fn insert_mir_place(&mut self, place: &Place<'_>)

Insert a MIR place as a relevance root.

Source

pub fn insert_contract_place(&mut self, place: &ContractPlace<'_>)

Insert a contract place as a relevance root.

Source

pub fn insert_place_key(&mut self, place: PlaceKey)

Insert a prebuilt place key as a relevance root.

Source

pub fn extend(&mut self, other: RelevantPlaces)

Merge another relevance set into this one.

Source

pub fn remove_place_keys(&mut self, places: &[PlaceKey])

Remove a list of place keys and rebuild the derived local set.

Source

pub fn intersects(&self, other: &RelevantPlaces) -> bool

Return true if this set shares any known root with other.

Source

pub fn remove_all(&mut self, other: &RelevantPlaces)

Remove all roots contained in other from this set.

Source

fn rebuild_locals(&mut self)

Source

fn collect_property(&mut self, property: &Property<'_>)

Collect all roots mentioned by a property.

Source

fn collect_target_argument_root( &mut self, kind: &PropertyKind, arg_index: usize, arg: &PropertyArg<'_>, ) -> bool

Collect a numeric std-contract target argument as a callee argument root.

Source

fn collect_property_arg(&mut self, arg: &PropertyArg<'_>)

Collect all roots mentioned by a property argument.

Source

fn collect_numeric_predicate(&mut self, predicate: &NumericPredicate<'_>)

Collect all roots mentioned by a numeric predicate.

Source

fn collect_contract_expr(&mut self, expr: &ContractExpr<'_>)

Collect all roots mentioned by a contract expression.

Trait Implementations§

Source§

impl Clone for RelevantPlaces

Source§

fn clone(&self) -> RelevantPlaces

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RelevantPlaces

Source§

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

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

impl Default for RelevantPlaces

Source§

fn default() -> RelevantPlaces

Returns the “default value” for a type. Read more

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,