use rustc::ty::{self, TyCtxt};
use rustc::ty::RegionVid;
-use rustc_data_structures::bit_set::BitSet;
+use rustc_index::bit_set::BitSet;
use rustc_data_structures::fx::FxHashMap;
-use rustc_data_structures::indexed_vec::{Idx, IndexVec};
+use rustc_index::vec::{Idx, IndexVec};
use crate::dataflow::{BitDenotation, BottomValue, GenKillSet};
use crate::borrow_check::nll::region_infer::RegionInferenceContext;
use std::rc::Rc;
-newtype_index! {
+rustc_index::newtype_index! {
pub struct BorrowIndex {
DEBUG_FORMAT = "bw{}"
}
// If the borrowed place is a local with no projections, all other borrows of this
// local must conflict. This is purely an optimization so we don't have to call
// `places_conflict` for every borrow.
- if place.projection.is_none() {
+ if place.projection.is_empty() {
trans.kill_all(other_borrows_of_local);
return;
}
debug!("Borrows::statement_effect: stmt={:?}", stmt);
match stmt.kind {
- mir::StatementKind::Assign(ref lhs, ref rhs) => {
- // Make sure there are no remaining borrows for variables
- // that are assigned over.
- self.kill_borrows_on_place(trans, lhs);
-
- if let mir::Rvalue::Ref(_, _, ref place) = **rhs {
+ mir::StatementKind::Assign(box(ref lhs, ref rhs)) => {
+ if let mir::Rvalue::Ref(_, _, ref place) = *rhs {
if place.ignore_borrow(
self.tcx,
self.body,
trans.gen(*index);
}
+
+ // Make sure there are no remaining borrows for variables
+ // that are assigned over.
+ self.kill_borrows_on_place(trans, lhs);
}
mir::StatementKind::StorageDead(local) => {