]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_infer/src/infer/mod.rs
remove `commit_unconditionally`
[rust.git] / compiler / rustc_infer / src / infer / mod.rs
index b3dc2e586d251849b2fa63eb211241e68e53496d..a551abf58d1152cf8a2b5a391a95a5f4b8dbd902 100644 (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>