Skip to content

Commit b81e74c

Browse files
committed
remove commit_unconditionally
1 parent c12f5fc commit b81e74c

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

compiler/rustc_infer/src/infer/mod.rs

-12
Original file line numberDiff line numberDiff line change
@@ -813,18 +813,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
813813
self.inner.borrow_mut().commit(undo_snapshot);
814814
}
815815

816-
/// Executes `f` and commit the bindings.
817-
#[instrument(skip(self, f), level = "debug")]
818-
pub fn commit_unconditionally<R, F>(&self, f: F) -> R
819-
where
820-
F: FnOnce(&CombinedSnapshot<'a, 'tcx>) -> R,
821-
{
822-
let snapshot = self.start_snapshot();
823-
let r = f(&snapshot);
824-
self.commit_from(snapshot);
825-
r
826-
}
827-
828816
/// Execute `f` and commit the bindings if closure `f` returns `Ok(_)`.
829817
#[instrument(skip(self, f), level = "debug")]
830818
pub fn commit_if_ok<T, E, F>(&self, f: F) -> Result<T, E>

compiler/rustc_typeck/src/check/coercion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
737737
F: FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>>,
738738
G: FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>>,
739739
{
740-
self.commit_unconditionally(|snapshot| {
740+
self.commit_if_ok(|snapshot| {
741741
let result = if let ty::FnPtr(fn_ty_b) = b.kind()
742742
&& let (hir::Unsafety::Normal, hir::Unsafety::Unsafe) =
743743
(fn_ty_a.unsafety(), fn_ty_b.unsafety())

0 commit comments

Comments
 (0)