pub struct Aliases<'tcx> { /* private fields */ }
Expand description
Data structure for computing and storing aliases.
Implementations§
Source§impl<'tcx> Aliases<'tcx>
impl<'tcx> Aliases<'tcx>
Sourcepub fn build<'a>(
tcx: TyCtxt<'tcx>,
def_id: DefId,
input: impl FlowistryInput<'tcx, 'a>,
) -> Self
pub fn build<'a>( tcx: TyCtxt<'tcx>, def_id: DefId, input: impl FlowistryInput<'tcx, 'a>, ) -> Self
Runs the alias analysis on a given body_with_facts
.
Sourcepub fn aliases(&self, place: Place<'tcx>) -> PlaceSet<'tcx>
pub fn aliases(&self, place: Place<'tcx>) -> PlaceSet<'tcx>
Given a place
, returns the set of direct places it could refer to.
For example, in the program:
let x = 1;
let y = &x;
The place *y
(but NOT y
) is an alias for x
. Similarly, in the program:
let v = vec![1, 2, 3];
let n = &v[0];
The place *n
is an alias for v
(even though they have different types!).
Auto Trait Implementations§
impl<'tcx> Freeze for Aliases<'tcx>
impl<'tcx> !RefUnwindSafe for Aliases<'tcx>
impl<'tcx> !Send for Aliases<'tcx>
impl<'tcx> !Sync for Aliases<'tcx>
impl<'tcx> Unpin for Aliases<'tcx>
impl<'tcx> !UnwindSafe for Aliases<'tcx>
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
Mutably borrows from an owned value. Read more
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>
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 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>
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