Struct rustc_mir::borrow_check::borrow_set::BorrowSet [−][src]
struct BorrowSet<'tcx> { borrows: IndexVec<BorrowIndex, BorrowData<'tcx>>, location_map: FxHashMap<Location, BorrowIndex>, activation_map: FxHashMap<Location, Vec<BorrowIndex>>, region_map: FxHashMap<Region<'tcx>, FxHashSet<BorrowIndex>>, local_map: FxHashMap<Local, FxHashSet<BorrowIndex>>, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields
borrows: IndexVec<BorrowIndex, BorrowData<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The fundamental map relating bitvector indexes to the borrows in the MIR.
location_map: FxHashMap<Location, BorrowIndex>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Each borrow is also uniquely identified in the MIR by the
Location
of the assignment statement in which it appears on
the right hand side; we map each such location to the
corresponding BorrowIndex
.
activation_map: FxHashMap<Location, Vec<BorrowIndex>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Locations which activate borrows. NOTE: A given location may activate more than one borrow in the future when more general two-phase borrow support is introduced, but for now we only need to store one borrow index
region_map: FxHashMap<Region<'tcx>, FxHashSet<BorrowIndex>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Every borrow has a region; this maps each such regions back to its borrow-indexes.
local_map: FxHashMap<Local, FxHashSet<BorrowIndex>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Map from local to all the borrows on that local
Methods
impl<'tcx> BorrowSet<'tcx>
[src]
impl<'tcx> BorrowSet<'tcx>
pub fn build(tcx: TyCtxt<'_, '_, 'tcx>, mir: &Mir<'tcx>) -> Self
[src]
pub fn build(tcx: TyCtxt<'_, '_, 'tcx>, mir: &Mir<'tcx>) -> Self
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn activations_at_location(&self, location: Location) -> &[BorrowIndex]
[src]
fn activations_at_location(&self, location: Location) -> &[BorrowIndex]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl<'tcx> Index<BorrowIndex> for BorrowSet<'tcx>
[src]
impl<'tcx> Index<BorrowIndex> for BorrowSet<'tcx>
type Output = BorrowData<'tcx>
The returned type after indexing.
fn index(&self, index: BorrowIndex) -> &BorrowData<'tcx>
[src]
fn index(&self, index: BorrowIndex) -> &BorrowData<'tcx>
Performs the indexing (container[index]
) operation.