[][src]Struct rustc_mir::dataflow::impls::Borrows

pub struct Borrows<'a, 'tcx> {
    tcx: TyCtxt<'tcx>,
    body: &'a Body<'tcx>,
    borrow_set: Rc<BorrowSet<'tcx>>,
    borrows_out_of_scope_at_location: FxHashMap<Location, Vec<BorrowIndex>>,
    _nonlexical_regioncx: Rc<RegionInferenceContext<'tcx>>,
}

Borrows stores the data used in the analyses that track the flow of borrows.

It uniquely identifies every borrow (Rvalue::Ref) by a BorrowIndex, and maps each such index to a BorrowData describing the borrow. These indexes are used for representing the borrows in compact bitvectors.

Fields

tcx: TyCtxt<'tcx>body: &'a Body<'tcx>borrow_set: Rc<BorrowSet<'tcx>>borrows_out_of_scope_at_location: FxHashMap<Location, Vec<BorrowIndex>>_nonlexical_regioncx: Rc<RegionInferenceContext<'tcx>>

NLL region inference context with which NLL queries should be resolved

Implementations

impl<'a, 'tcx> Borrows<'a, 'tcx>[src]

pub(crate) fn new(
    tcx: TyCtxt<'tcx>,
    body: &'a Body<'tcx>,
    nonlexical_regioncx: Rc<RegionInferenceContext<'tcx>>,
    borrow_set: &Rc<BorrowSet<'tcx>>
) -> Self
[src]

pub fn location(&self, idx: BorrowIndex) -> &Location[src]

pub(in dataflow::impls::borrows) fn kill_loans_out_of_scope_at_location(
    &self,
    trans: &mut impl GenKill<BorrowIndex>,
    location: Location
)
[src]

Add all borrows to the kill set, if those borrows are out of scope at location. That means they went out of a nonlexical scope

pub(in dataflow::impls::borrows) fn kill_borrows_on_place(
    &self,
    trans: &mut impl GenKill<BorrowIndex>,
    place: Place<'tcx>
)
[src]

Kill any borrows that conflict with place.

Trait Implementations

impl<'tcx, '_> AnalysisDomain<'tcx> for Borrows<'_, 'tcx>[src]

type Domain = BitSet<BorrowIndex>

The type that holds the dataflow state at any given point in the program.

impl<'_, '_> DebugWithContext<Borrows<'_, '_>> for BorrowIndex[src]

impl<'tcx, '_> GenKillAnalysis<'tcx> for Borrows<'_, 'tcx>[src]

type Idx = BorrowIndex

Auto Trait Implementations

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

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

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

impl<'a, 'tcx> Unpin for Borrows<'a, 'tcx> where
    'tcx: 'a, 

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]