//! This query borrow-checks the MIR to (further) ensure it is not broken.
-use rustc::infer::InferCtxt;
use rustc::lint::builtin::MUTABLE_BORROW_RESERVATION_CONFLICT;
use rustc::lint::builtin::UNUSED_MUT;
use rustc::mir::{
use rustc_hir::{def_id::DefId, HirId, Node};
use rustc_index::bit_set::BitSet;
use rustc_index::vec::IndexVec;
+use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
use either::Either;
use smallvec::SmallVec;
// Skip over locals that begin with an underscore or have no name
match mbcx.local_names[local] {
Some(name) => {
- if name.as_str().starts_with("_") {
+ if name.as_str().starts_with('_') {
continue;
}
}
) {
if let Some(mpi) = self.move_path_for_place(place_span.0) {
let move_paths = &self.move_data.move_paths;
- let mut child = move_paths[mpi].first_child;
- while let Some(child_mpi) = child {
- let child_move_path = &move_paths[child_mpi];
+
+ let root_path = &move_paths[mpi];
+ for (child_mpi, child_move_path) in root_path.children(move_paths) {
let last_proj = child_move_path.place.projection.last().unwrap();
if let ProjectionElem::ConstantIndex { offset, from_end, .. } = last_proj {
debug_assert!(!from_end, "Array constant indexing shouldn't be `from_end`.");
}
}
}
- child = child_move_path.next_sibling;
}
}
}