Struct rustc_mir::borrow_check::borrow_set::GatherBorrows[][src]

struct GatherBorrows<'a, 'tcx> {
    tcx: TyCtxt<'tcx>,
    body: &'a Body<'tcx>,
    location_map: FxIndexMap<Location, BorrowData<'tcx>>,
    activation_map: FxHashMap<Location, Vec<BorrowIndex>>,
    local_map: FxHashMap<Local, FxHashSet<BorrowIndex>>,
    pending_activations: FxHashMap<Local, BorrowIndex>,
    locals_state_at_exit: LocalsStateAtExit,


tcx: TyCtxt<'tcx>body: &'a Body<'tcx>location_map: FxIndexMap<Location, BorrowData<'tcx>>activation_map: FxHashMap<Location, Vec<BorrowIndex>>local_map: FxHashMap<Local, FxHashSet<BorrowIndex>>pending_activations: FxHashMap<Local, BorrowIndex>

When we encounter a 2-phase borrow statement, it will always be assigning into a temporary TEMP:

TEMP = &foo

We add TEMP into this map with b, where b is the index of the borrow. When we find a later use of this activation, we remove from the map (and add to the “tombstone” set below).

locals_state_at_exit: LocalsStateAtExit


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

fn insert_as_pending_if_two_phase(
    &mut self,
    start_location: Location,
    assigned_place: &Place<'tcx>,
    kind: BorrowKind,
    borrow_index: BorrowIndex

If this is a two-phase borrow, then we will record it as “pending” until we find the activating use.

Trait Implementations

impl<'a, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'tcx>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]