]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/renumber.rs
Auto merge of #69076 - cjgillot:split_trait, r=matthewjasper
[rust.git] / src / librustc_mir / borrow_check / renumber.rs
index ba323b113e9ebf23b6428970f1fb87327715a097..a63d18c27f1195a8a854fa1da3cbaa6c986d8406 100644 (file)
@@ -1,9 +1,9 @@
+use rustc::mir::visit::{MutVisitor, TyContext};
+use rustc::mir::{BodyAndCache, Location, PlaceElem, Promoted};
 use rustc::ty::subst::SubstsRef;
 use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
-use rustc::mir::{BodyAndCache, Location, PlaceElem, Promoted};
-use rustc::mir::visit::{MutVisitor, TyContext};
-use rustc::infer::{InferCtxt, NLLRegionVariableOrigin};
 use rustc_index::vec::IndexVec;
+use rustc_infer::infer::{InferCtxt, NLLRegionVariableOrigin};
 
 /// Replaces all free regions appearing in the MIR with fresh
 /// inference variables, returning the number of variables created.
@@ -32,12 +32,10 @@ pub fn renumber_regions<'tcx, T>(infcx: &InferCtxt<'_, 'tcx>, value: &T) -> T
 {
     debug!("renumber_regions(value={:?})", value);
 
-    infcx
-        .tcx
-        .fold_regions(value, &mut false, |_region, _depth| {
-            let origin = NLLRegionVariableOrigin::Existential { from_forall: false };
-            infcx.next_nll_region_var(origin)
-        })
+    infcx.tcx.fold_regions(value, &mut false, |_region, _depth| {
+        let origin = NLLRegionVariableOrigin::Existential { from_forall: false };
+        infcx.next_nll_region_var(origin)
+    })
 }
 
 struct NLLVisitor<'a, 'tcx> {
@@ -66,10 +64,7 @@ fn visit_ty(&mut self, ty: &mut Ty<'tcx>, ty_context: TyContext) {
         debug!("visit_ty: ty={:?}", ty);
     }
 
-    fn process_projection_elem(
-        &mut self,
-        elem: &PlaceElem<'tcx>,
-    ) -> Option<PlaceElem<'tcx>> {
+    fn process_projection_elem(&mut self, elem: &PlaceElem<'tcx>) -> Option<PlaceElem<'tcx>> {
         if let PlaceElem::Field(field, ty) = elem {
             let new_ty = self.renumber_regions(ty);