]> git.lizzy.rs Git - rust.git/commitdiff
Remove unneeded `origin` arg from `iterate_until_fixed_point`'s closure.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 17 Jan 2019 22:51:24 +0000 (09:51 +1100)
committerNicholas Nethercote <nnethercote@mozilla.com>
Fri, 18 Jan 2019 00:37:22 +0000 (11:37 +1100)
src/librustc/infer/lexical_region_resolve/mod.rs

index 39ce8cc621b49d9215de6dfe3998085a937eead7..f45ed395c414fc8f31c0a186ccf7f4915ae2b2fc 100644 (file)
@@ -186,8 +186,8 @@ fn expand_givens(&mut self, graph: &RegionGraph<'_>) {
     }
 
     fn expansion(&self, var_values: &mut LexicalRegionResolutions<'tcx>) {
-        self.iterate_until_fixed_point("Expansion", |constraint, origin| {
-            debug!("expansion: constraint={:?} origin={:?}", constraint, origin);
+        self.iterate_until_fixed_point("Expansion", |constraint| {
+            debug!("expansion: constraint={:?}", constraint);
             match *constraint {
                 Constraint::RegSubVar(a_region, b_vid) => {
                     let b_data = var_values.value_mut(b_vid);
@@ -722,18 +722,17 @@ fn process_edges<'tcx>(
     }
 
     fn iterate_until_fixed_point<F>(&self, tag: &str, mut body: F)
-    where
-        F: FnMut(&Constraint<'tcx>, &SubregionOrigin<'tcx>) -> (bool, bool),
+        where F: FnMut(&Constraint<'tcx>) -> (bool, bool),
     {
-        let mut constraints: SmallVec<[_; 16]> = self.data.constraints.iter().collect();
+        let mut constraints: SmallVec<[_; 16]> = self.data.constraints.keys().collect();
         let mut iteration = 0;
         let mut changed = true;
         while changed {
             changed = false;
             iteration += 1;
             debug!("---- {} Iteration {}{}", "#", tag, iteration);
-            constraints.retain(|(constraint, origin)| {
-                let (edge_changed, retain) = body(constraint, origin);
+            constraints.retain(|constraint| {
+                let (edge_changed, retain) = body(constraint);
                 if edge_changed {
                     debug!("Updated due to constraint {:?}", constraint);
                     changed = true;