about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-10-15 17:20:10 -0400
committerNiko Matsakis <niko@alum.mit.edu>2019-01-02 17:35:04 -0500
commit5f0fe8f093555c9f435dcb8ec0dfa6552ef0e492 (patch)
tree04f02e27a57d88195df5eb28af961a4fff6a93aa
parentec194646fef1a467073ad74b8b68f6f202cfce97 (diff)
downloadrust-5f0fe8f093555c9f435dcb8ec0dfa6552ef0e492.tar.gz
rust-5f0fe8f093555c9f435dcb8ec0dfa6552ef0e492.zip
remove `commit_if_ok` wrapper
-rw-r--r--src/librustc/traits/select.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs
index bd347764cc6..1832d35e3ae 100644
--- a/src/librustc/traits/select.rs
+++ b/src/librustc/traits/select.rs
@@ -549,15 +549,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
         self.infcx.probe(|snapshot| f(self, snapshot))
     }
 
-    /// Wraps a commit_if_ok s.t. obligations collected during it are not returned in selection if
-    /// the transaction fails and s.t. old obligations are retained.
-    fn commit_if_ok<T, E, F>(&mut self, f: F) -> Result<T, E>
-    where
-        F: FnOnce(&mut Self, &infer::CombinedSnapshot<'cx, 'tcx>) -> Result<T, E>,
-    {
-        self.infcx.commit_if_ok(|snapshot| f(self, snapshot))
-    }
-
     ///////////////////////////////////////////////////////////////////////////
     // Selection
     //
@@ -3041,7 +3032,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
             // reported an ambiguity. (When we do find a match, also
             // record it for later.)
             let nonmatching = util::supertraits(tcx, poly_trait_ref).take_while(
-                |&t| match self.commit_if_ok(|this, _| this.match_poly_trait_ref(obligation, t)) {
+                |&t| match self.infcx.commit_if_ok(|_| self.match_poly_trait_ref(obligation, t)) {
                     Ok(obligations) => {
                         upcast_trait_ref = Some(t);
                         nested.extend(obligations);