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,
}

Fields

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

Implementations

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

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 200 bytes