about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-08-05 07:42:18 +0200
committerNiko Matsakis <niko@alum.mit.edu>2018-08-05 07:42:18 +0200
commit2e2ea26a8305d44e2441b8a97e05f7f4d69f7220 (patch)
tree864059d4eab0103a6e38ea29683a6c0c7e46ce75 /src
parent5e2f337e6bc5a1b6bd1cfe0458acb4d5f3ff3c8b (diff)
downloadrust-2e2ea26a8305d44e2441b8a97e05f7f4d69f7220.tar.gz
rust-2e2ea26a8305d44e2441b8a97e05f7f4d69f7220.zip
remove unused tcx argument
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/borrow_check/nll/escaping_locals.rs17
-rw-r--r--src/librustc_mir/borrow_check/nll/liveness_map.rs6
-rw-r--r--src/librustc_mir/borrow_check/nll/mod.rs2
3 files changed, 10 insertions, 15 deletions
diff --git a/src/librustc_mir/borrow_check/nll/escaping_locals.rs b/src/librustc_mir/borrow_check/nll/escaping_locals.rs
index 357b1bb5033..7e39f3d3b08 100644
--- a/src/librustc_mir/borrow_check/nll/escaping_locals.rs
+++ b/src/librustc_mir/borrow_check/nll/escaping_locals.rs
@@ -44,7 +44,6 @@
 
 use rustc::mir::visit::Visitor;
 use rustc::mir::*;
-use rustc::ty::TyCtxt;
 
 use rustc_data_structures::indexed_vec::Idx;
 use rustc_data_structures::unify as ut;
@@ -54,8 +53,8 @@ crate struct EscapingLocals {
 }
 
 impl EscapingLocals {
-    crate fn compute(tcx: TyCtxt<'_, '_, 'tcx>, mir: &Mir<'tcx>) -> Self {
-        let mut visitor = GatherAssignedLocalsVisitor::new(tcx, mir);
+    crate fn compute(mir: &Mir<'tcx>) -> Self {
+        let mut visitor = GatherAssignedLocalsVisitor::new();
         visitor.visit_mir(mir);
 
         EscapingLocals {
@@ -74,10 +73,8 @@ impl EscapingLocals {
 
 /// The MIR visitor gathering the union-find of the locals used in
 /// assignments.
-struct GatherAssignedLocalsVisitor<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
+struct GatherAssignedLocalsVisitor {
     unification_table: ut::UnificationTable<ut::InPlace<AssignedLocal>>,
-    tcx: TyCtxt<'cx, 'gcx, 'tcx>,
-    mir: &'cx Mir<'tcx>,
 }
 
 #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
@@ -107,12 +104,10 @@ impl From<Local> for AssignedLocal {
     }
 }
 
-impl GatherAssignedLocalsVisitor<'cx, 'gcx, 'tcx> {
-    fn new(tcx: TyCtxt<'cx, 'gcx, 'tcx>, mir: &'cx Mir<'tcx>) -> Self {
+impl GatherAssignedLocalsVisitor {
+    fn new() -> Self {
         Self {
             unification_table: ut::UnificationTable::new(),
-            tcx,
-            mir,
         }
     }
 
@@ -154,7 +149,7 @@ fn find_local_in_operand(op: &Operand) -> Option<Local> {
     }
 }
 
-impl Visitor<'tcx> for GatherAssignedLocalsVisitor<'_, '_, 'tcx> {
+impl Visitor<'tcx> for GatherAssignedLocalsVisitor {
     fn visit_mir(&mut self, mir: &Mir<'tcx>) {
         // We need as many union-find keys as there are locals
         for _ in 0..mir.local_decls.len() {
diff --git a/src/librustc_mir/borrow_check/nll/liveness_map.rs b/src/librustc_mir/borrow_check/nll/liveness_map.rs
index 771be05422c..d018a9277d8 100644
--- a/src/librustc_mir/borrow_check/nll/liveness_map.rs
+++ b/src/librustc_mir/borrow_check/nll/liveness_map.rs
@@ -18,7 +18,7 @@
 
 use borrow_check::nll::escaping_locals::EscapingLocals;
 use rustc::mir::{Local, Mir};
-use rustc::ty::{TyCtxt, TypeFoldable};
+use rustc::ty::TypeFoldable;
 use rustc_data_structures::indexed_vec::IndexVec;
 use util::liveness::LiveVariableMap;
 
@@ -55,8 +55,8 @@ impl LiveVariableMap for NllLivenessMap {
 impl NllLivenessMap {
     /// Iterates over the variables in Mir and assigns each Local whose type contains
     /// regions a LocalWithRegion index. Returns a map for converting back and forth.
-    crate fn compute(tcx: TyCtxt<'_, '_, 'tcx>, mir: &Mir<'tcx>) -> Self {
-        let mut escaping_locals = EscapingLocals::compute(tcx, mir);
+    crate fn compute(mir: &Mir<'tcx>) -> Self {
+        let mut escaping_locals = EscapingLocals::compute(mir);
 
         let mut to_local = IndexVec::default();
         let mut escapes_into_return = 0;
diff --git a/src/librustc_mir/borrow_check/nll/mod.rs b/src/librustc_mir/borrow_check/nll/mod.rs
index cc070a37ba1..44ed6b7676c 100644
--- a/src/librustc_mir/borrow_check/nll/mod.rs
+++ b/src/librustc_mir/borrow_check/nll/mod.rs
@@ -109,7 +109,7 @@ pub(in borrow_check) fn compute_regions<'cx, 'gcx, 'tcx>(
     let elements = &Rc::new(RegionValueElements::new(mir));
 
     // Run the MIR type-checker.
-    let liveness_map = NllLivenessMap::compute(infcx.tcx, &mir);
+    let liveness_map = NllLivenessMap::compute(&mir);
     let liveness = LivenessResults::compute(mir, &liveness_map);
     let (constraint_sets, universal_region_relations) = type_check::type_check(
         infcx,