Skip to content

Commit 5f0fe8f

Browse files
committed
remove commit_if_ok wrapper
1 parent ec19464 commit 5f0fe8f

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/librustc/traits/select.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -549,15 +549,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
549549
self.infcx.probe(|snapshot| f(self, snapshot))
550550
}
551551

552-
/// Wraps a commit_if_ok s.t. obligations collected during it are not returned in selection if
553-
/// the transaction fails and s.t. old obligations are retained.
554-
fn commit_if_ok<T, E, F>(&mut self, f: F) -> Result<T, E>
555-
where
556-
F: FnOnce(&mut Self, &infer::CombinedSnapshot<'cx, 'tcx>) -> Result<T, E>,
557-
{
558-
self.infcx.commit_if_ok(|snapshot| f(self, snapshot))
559-
}
560-
561552
///////////////////////////////////////////////////////////////////////////
562553
// Selection
563554
//
@@ -3041,7 +3032,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
30413032
// reported an ambiguity. (When we do find a match, also
30423033
// record it for later.)
30433034
let nonmatching = util::supertraits(tcx, poly_trait_ref).take_while(
3044-
|&t| match self.commit_if_ok(|this, _| this.match_poly_trait_ref(obligation, t)) {
3035+
|&t| match self.infcx.commit_if_ok(|_| self.match_poly_trait_ref(obligation, t)) {
30453036
Ok(obligations) => {
30463037
upcast_trait_ref = Some(t);
30473038
nested.extend(obligations);

0 commit comments

Comments
 (0)