pub struct PlaceInfo<'a, 'tcx> { /* private fields */ }
Expand description

Utilities for analyzing places: children, aliases, etc.

Implementations§

source§

impl<'a, 'tcx> PlaceInfo<'a, 'tcx>

source

pub fn build( tcx: TyCtxt<'tcx>, def_id: DefId, body_with_facts: &'a BodyWithBorrowckFacts<'tcx> ) -> Self

Computes all the metadata about places used within the infoflow analysis.

source

pub fn normalize(&self, place: Place<'tcx>) -> Place<'tcx>

Normalizes a place via PlaceExt::normalize (cached).

See the PlaceExt documentation for details on how normalization works.

source

pub fn aliases(&self, place: Place<'tcx>) -> &PlaceSet<'tcx>

Computes the aliases of a place (cached).

For example, if x = &y, then *x aliases y. Note that an alias is NOT guaranteed to be of the same type as place!

source

pub fn children(&self, place: Place<'tcx>) -> PlaceSet<'tcx>

Returns all reachable fields of place without going through references.

For example, if x = (0, 1) then children(x) = {x, x.0, x.1}.

source

pub fn conflicts(&self, place: Place<'tcx>) -> &PlaceSet<'tcx>

Returns all places that conflict with place, i.e. that a mutation to place would also be a mutation to the conflicting place.

For example, if x = ((0, 1), 2) then conflicts(x.0) = {x, x.0, x.0.0, x.0.1}, but not x.1.

source

pub fn reachable_values( &self, place: Place<'tcx>, mutability: Mutability ) -> &PlaceSet<'tcx>

Returns all direct places that are reachable from place and can be used at the provided level of Mutability (cached).

For example, if x = 0 and y = (0, &x), then reachable_values(y, Mutability::Not) is {y, x}. With Mutability::Mut, then the output is {y} (no x).

source

pub fn all_args( &'a self ) -> impl Iterator<Item = (Place<'tcx>, LocationOrArgIndex)> + 'a

Returns all direct places reachable from arguments to the current body.

source

pub fn location_domain(&self) -> &Rc<LocationOrArgDomain>

Returns the LocationOrArgDomain for the current body.

Auto Trait Implementations§

§

impl<'a, 'tcx> !RefUnwindSafe for PlaceInfo<'a, 'tcx>

§

impl<'a, 'tcx> !Send for PlaceInfo<'a, 'tcx>

§

impl<'a, 'tcx> !Sync for PlaceInfo<'a, 'tcx>

§

impl<'a, 'tcx> Unpin for PlaceInfo<'a, 'tcx>

§

impl<'a, 'tcx> !UnwindSafe for PlaceInfo<'a, 'tcx>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.