remove commit_unconditionally
This commit is contained in:
parent
c12f5fc006
commit
b81e74ceb7
2 changed files with 1 additions and 13 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue