]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/places_conflict.rs
Rollup merge of #58306 - GuillaumeGomez:crate-browser-history, r=QuietMisdreavus
[rust.git] / src / librustc_mir / borrow_check / places_conflict.rs
index 88c27a869c0892876da271f5bd5d49d9d0dc9f79..b5175cf41dd5c6293d7ba989d40636ab58646ea9 100644 (file)
@@ -1,6 +1,6 @@
-use borrow_check::ArtificialField;
-use borrow_check::Overlap;
-use borrow_check::{Deep, Shallow, AccessDepth};
+use crate::borrow_check::ArtificialField;
+use crate::borrow_check::Overlap;
+use crate::borrow_check::{Deep, Shallow, AccessDepth};
 use rustc::hir;
 use rustc::mir::{BorrowKind, Mir, Place};
 use rustc::mir::{Projection, ProjectionElem};
@@ -275,10 +275,10 @@ fn place_components_conflict<'gcx, 'tcx>(
 
 /// A linked list of places running up the stack; begins with the
 /// innermost place and extends to projections (e.g., `a.b` would have
-/// the place `a` with a "next" pointer to `a.b`).  Created by
+/// the place `a` with a "next" pointer to `a.b`). Created by
 /// `unroll_place`.
 ///
-/// N.B., this particular impl strategy is not the most obvious.  It was
+/// N.B., this particular impl strategy is not the most obvious. It was
 /// chosen because it makes a measurable difference to NLL
 /// performance, as this code (`borrow_conflicts_with_place`) is somewhat hot.
 struct PlaceComponents<'p, 'tcx: 'p> {
@@ -388,7 +388,7 @@ fn place_element_conflict<'a, 'gcx: 'tcx, 'tcx>(
         (Place::Promoted(p1), Place::Promoted(p2)) => {
             if p1.0 == p2.0 {
                 if let ty::Array(_, size) = p1.1.sty {
-                    if size.unwrap_evaluated().unwrap_usize(tcx) == 0 {
+                    if size.unwrap_usize(tcx) == 0 {
                         // Ignore conflicts with promoted [T; 0].
                         debug!("place_element_conflict: IGNORE-LEN-0-PROMOTED");
                         return Overlap::Disjoint;