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 @@ fn commit_from(&self, snapshot: CombinedSnapshot<'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>

View File

@ -737,7 +737,7 @@ fn coerce_from_safe_fn<F, G>(
F: FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>>,
G: FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>>,
{
self.commit_unconditionally(|snapshot| {
self.commit_if_ok(|snapshot| {
let result = if let ty::FnPtr(fn_ty_b) = b.kind()
&& let (hir::Unsafety::Normal, hir::Unsafety::Unsafe) =
(fn_ty_a.unsafety(), fn_ty_b.unsafety())