about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2020-05-22 18:19:54 +0000
committerNiko Matsakis <niko@alum.mit.edu>2020-06-22 18:51:07 +0000
commit3a68d56de307cae00dd0a9f6908e52889006a1ff (patch)
tree4b4a2727372ea28d4bea0788ce6b88eb78faa20a
parent6873a76f2c34a318a540df65901d07baba1d217b (diff)
downloadrust-3a68d56de307cae00dd0a9f6908e52889006a1ff.tar.gz
rust-3a68d56de307cae00dd0a9f6908e52889006a1ff.zip
remove `leak_check` from the outlives predicate evaluations
-rw-r--r--src/librustc_infer/infer/mod.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/librustc_infer/infer/mod.rs b/src/librustc_infer/infer/mod.rs
index 0e569be34aa..8f8ce03d638 100644
--- a/src/librustc_infer/infer/mod.rs
+++ b/src/librustc_infer/infer/mod.rs
@@ -991,14 +991,12 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
             return None;
         }
 
-        Some(self.commit_if_ok(|snapshot| {
+        Some(self.commit_if_ok(|_snapshot| {
             let (ty::SubtypePredicate { a_is_expected, a, b }, _) =
                 self.replace_bound_vars_with_placeholders(&predicate);
 
             let ok = self.at(cause, param_env).sub_exp(a_is_expected, a, b)?;
 
-            self.leak_check(false, snapshot)?;
-
             Ok(ok.unit())
         }))
     }
@@ -1008,14 +1006,13 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
         cause: &traits::ObligationCause<'tcx>,
         predicate: ty::PolyRegionOutlivesPredicate<'tcx>,
     ) -> UnitResult<'tcx> {
-        self.commit_if_ok(|snapshot| {
+        self.commit_if_ok(|_snapshot| {
             let (ty::OutlivesPredicate(r_a, r_b), _) =
                 self.replace_bound_vars_with_placeholders(&predicate);
             let origin = SubregionOrigin::from_obligation_cause(cause, || {
                 RelateRegionParamBound(cause.span)
             });
             self.sub_regions(origin, r_b, r_a); // `b : a` ==> `a <= b`
-            self.leak_check(false, snapshot)?;
             Ok(())
         })
     }