X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Fdataflow%2Fimpls%2Fborrows.rs;h=5e64144df2cd1c371d93d4b1b995017f191f3fd3;hb=25f774a4cfe4a2686de6c6d628db33c65e231039;hp=2ea6c4ae10fdc8f84682950a38f8ae232b8896fd;hpb=07a28338faf3c7f637134a6906f8f6dc2239ceb8;p=rust.git diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs index 2ea6c4ae10f..5e64144df2c 100644 --- a/src/librustc_mir/dataflow/impls/borrows.rs +++ b/src/librustc_mir/dataflow/impls/borrows.rs @@ -5,9 +5,9 @@ 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; @@ -16,7 +16,7 @@ use std::rc::Rc; -newtype_index! { +rustc_index::newtype_index! { pub struct BorrowIndex { DEBUG_FORMAT = "bw{}" } @@ -208,7 +208,7 @@ fn kill_borrows_on_place( // 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; } @@ -268,8 +268,8 @@ fn statement_effect(&self, debug!("Borrows::statement_effect: stmt={:?}", stmt); match stmt.kind { - mir::StatementKind::Assign(ref lhs, ref rhs) => { - 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,