1
Fork 0

Remove allow(potential_query_instability) from borrowck

This commit is contained in:
clubby789 2023-03-04 12:40:38 +00:00
parent 01b7a6a9ea
commit 3eeb3fd05a
15 changed files with 66 additions and 61 deletions

View file

@ -4,7 +4,7 @@ use crate::nll::ToRegionVid;
use crate::path_utils::allow_two_phase_borrow;
use crate::place_ext::PlaceExt;
use crate::BorrowIndex;
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
use rustc_index::bit_set::BitSet;
use rustc_middle::mir::traversal;
use rustc_middle::mir::visit::{MutatingUseContext, NonUseContext, PlaceContext, Visitor};
@ -26,10 +26,10 @@ pub struct BorrowSet<'tcx> {
/// 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.
pub activation_map: FxHashMap<Location, Vec<BorrowIndex>>,
pub activation_map: FxIndexMap<Location, Vec<BorrowIndex>>,
/// Map from local to all the borrows on that local.
pub local_map: FxHashMap<mir::Local, FxHashSet<BorrowIndex>>,
pub local_map: FxIndexMap<mir::Local, FxIndexSet<BorrowIndex>>,
pub(crate) locals_state_at_exit: LocalsStateAtExit,
}
@ -175,8 +175,8 @@ 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<mir::Local, FxHashSet<BorrowIndex>>,
activation_map: FxIndexMap<Location, Vec<BorrowIndex>>,
local_map: FxIndexMap<mir::Local, FxIndexSet<BorrowIndex>>,
/// When we encounter a 2-phase borrow statement, it will always
/// be assigning into a temporary TEMP:
@ -186,7 +186,7 @@ struct GatherBorrows<'a, 'tcx> {
/// 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).
pending_activations: FxHashMap<mir::Local, BorrowIndex>,
pending_activations: FxIndexMap<mir::Local, BorrowIndex>,
locals_state_at_exit: LocalsStateAtExit,
}