remove commit_unconditionally
This commit is contained in:
parent
c12f5fc006
commit
b81e74ceb7
@ -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>
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user