1
Fork 0

remove commit_unconditionally

This commit is contained in:
lcnr 2022-07-20 13:34:53 +02:00
parent c12f5fc006
commit b81e74ceb7
2 changed files with 1 additions and 13 deletions

View file

@ -813,18 +813,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
self.inner.borrow_mut().commit(undo_snapshot);
}
/// Executes `f` and commit the bindings.
#[instrument(skip(self, f), level = "debug")]
pub fn commit_unconditionally<R, F>(&self, f: F) -> R
where
F: FnOnce(&CombinedSnapshot<'a, 'tcx>) -> R,
{
let snapshot = self.start_snapshot();
let r = f(&snapshot);
self.commit_from(snapshot);
r
}
/// Execute `f` and commit the bindings if closure `f` returns `Ok(_)`.
#[instrument(skip(self, f), level = "debug")]
pub fn commit_if_ok<T, E, F>(&self, f: F) -> Result<T, E>