]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/nll/constraint_generation.rs
Rollup merge of #61273 - RalfJung:maybe-uninit, r=Centril
[rust.git] / src / librustc_mir / borrow_check / nll / constraint_generation.rs
index bfba9738a6488e57f6daa524a78d678e590b58bf..b485f37b78c2d8c5bfe35e6caf42b799c3e8cbc4 100644 (file)
@@ -6,11 +6,11 @@
 use rustc::infer::InferCtxt;
 use rustc::mir::visit::TyContext;
 use rustc::mir::visit::Visitor;
-use rustc::mir::{BasicBlock, BasicBlockData, Location, Mir, Place, PlaceBase, Rvalue};
+use rustc::mir::{BasicBlock, BasicBlockData, Location, Body, Place, PlaceBase, Rvalue};
 use rustc::mir::{SourceInfo, Statement, Terminator};
 use rustc::mir::UserTypeProjection;
 use rustc::ty::fold::TypeFoldable;
-use rustc::ty::{self, ClosureSubsts, GeneratorSubsts, RegionVid};
+use rustc::ty::{self, ClosureSubsts, GeneratorSubsts, RegionVid, Ty};
 use rustc::ty::subst::SubstsRef;
 
 pub(super) fn generate_constraints<'cx, 'gcx, 'tcx>(
@@ -18,7 +18,7 @@ pub(super) fn generate_constraints<'cx, 'gcx, 'tcx>(
     liveness_constraints: &mut LivenessValues<RegionVid>,
     all_facts: &mut Option<AllFacts>,
     location_table: &LocationTable,
-    mir: &Mir<'tcx>,
+    mir: &Body<'tcx>,
     borrow_set: &BorrowSet<'tcx>,
 ) {
     let mut cg = ConstraintGeneration {
@@ -64,7 +64,7 @@ fn visit_region(&mut self, region: &ty::Region<'tcx>, location: Location) {
 
     /// We sometimes have `ty` within an rvalue, or within a
     /// call. Make them live at the location where they appear.
-    fn visit_ty(&mut self, ty: &ty::Ty<'tcx>, ty_context: TyContext) {
+    fn visit_ty(&mut self, ty: Ty<'tcx>, ty_context: TyContext) {
         match ty_context {
             TyContext::ReturnTy(SourceInfo { span, .. })
             | TyContext::YieldTy(SourceInfo { span, .. })
@@ -77,7 +77,7 @@ fn visit_ty(&mut self, ty: &ty::Ty<'tcx>, ty_context: TyContext) {
                 );
             }
             TyContext::Location(location) => {
-                self.add_regular_live_constraint(*ty, location);
+                self.add_regular_live_constraint(ty, location);
             }
         }