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
impl RelevantPlaces
Sourcepub fn from_property(property: &Property<'_>) -> Self
pub fn from_property(property: &Property<'_>) -> Self
Extract initial relevance roots from a required property.
Sourcepub fn place_count(&self) -> usize
pub fn place_count(&self) -> usize
Return the number of contract-level places in this set.
Sourcepub fn local_count(&self) -> usize
pub fn local_count(&self) -> usize
Return the number of MIR locals in this set.
Sourcepub fn insert_local(&mut self, local: Local)
pub fn insert_local(&mut self, local: Local)
Insert a MIR local as a relevance root.
Sourcepub fn insert_mir_place(&mut self, place: &Place<'_>)
pub fn insert_mir_place(&mut self, place: &Place<'_>)
Insert a MIR place as a relevance root.
Sourcepub fn insert_contract_place(&mut self, place: &ContractPlace<'_>)
pub fn insert_contract_place(&mut self, place: &ContractPlace<'_>)
Insert a contract place as a relevance root.
Sourcepub fn insert_place_key(&mut self, place: PlaceKey)
pub fn insert_place_key(&mut self, place: PlaceKey)
Insert a prebuilt place key as a relevance root.
Sourcepub fn extend(&mut self, other: RelevantPlaces)
pub fn extend(&mut self, other: RelevantPlaces)
Merge another relevance set into this one.
Sourcepub fn remove_place_keys(&mut self, places: &[PlaceKey])
pub fn remove_place_keys(&mut self, places: &[PlaceKey])
Remove a list of place keys and rebuild the derived local set.
Sourcepub fn intersects(&self, other: &RelevantPlaces) -> bool
pub fn intersects(&self, other: &RelevantPlaces) -> bool
Return true if this set shares any known root with other.
Sourcepub fn remove_all(&mut self, other: &RelevantPlaces)
pub fn remove_all(&mut self, other: &RelevantPlaces)
Remove all roots contained in other from this set.
fn rebuild_locals(&mut self)
Sourcefn collect_property(&mut self, property: &Property<'_>)
fn collect_property(&mut self, property: &Property<'_>)
Collect all roots mentioned by a property.
Sourcefn collect_target_argument_root(
&mut self,
kind: &PropertyKind,
arg_index: usize,
arg: &PropertyArg<'_>,
) -> bool
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.
Sourcefn collect_property_arg(&mut self, arg: &PropertyArg<'_>)
fn collect_property_arg(&mut self, arg: &PropertyArg<'_>)
Collect all roots mentioned by a property argument.
Sourcefn collect_numeric_predicate(&mut self, predicate: &NumericPredicate<'_>)
fn collect_numeric_predicate(&mut self, predicate: &NumericPredicate<'_>)
Collect all roots mentioned by a numeric predicate.
Sourcefn collect_contract_expr(&mut self, expr: &ContractExpr<'_>)
fn collect_contract_expr(&mut self, expr: &ContractExpr<'_>)
Collect all roots mentioned by a contract expression.
Trait Implementations§
Source§impl Clone for RelevantPlaces
impl Clone for RelevantPlaces
Source§fn clone(&self) -> RelevantPlaces
fn clone(&self) -> RelevantPlaces
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RelevantPlaces
impl Debug for RelevantPlaces
Source§impl Default for RelevantPlaces
impl Default for RelevantPlaces
Source§fn default() -> RelevantPlaces
fn default() -> RelevantPlaces
Auto Trait Implementations§
impl Freeze for RelevantPlaces
impl RefUnwindSafe for RelevantPlaces
impl Send for RelevantPlaces
impl Sync for RelevantPlaces
impl Unpin for RelevantPlaces
impl UnwindSafe for RelevantPlaces
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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