diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-10-15 17:20:10 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2019-01-02 17:35:04 -0500 |
| commit | 5f0fe8f093555c9f435dcb8ec0dfa6552ef0e492 (patch) | |
| tree | 04f02e27a57d88195df5eb28af961a4fff6a93aa | |
| parent | ec194646fef1a467073ad74b8b68f6f202cfce97 (diff) | |
| download | rust-5f0fe8f093555c9f435dcb8ec0dfa6552ef0e492.tar.gz rust-5f0fe8f093555c9f435dcb8ec0dfa6552ef0e492.zip | |
remove `commit_if_ok` wrapper
| -rw-r--r-- | src/librustc/traits/select.rs | 11 |
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); |
