diff --git a/fish-rust/src/common.rs b/fish-rust/src/common.rs index 837ad6297..90d19f100 100644 --- a/fish-rust/src/common.rs +++ b/fish-rust/src/common.rs @@ -65,7 +65,7 @@ pub fn cancel(guard: &mut Self) { /// Cancels the unwind operation like [`ScopeGuard::cancel()`] but also returns the captured /// value (consuming the `ScopeGuard` in the process). pub fn rollback(mut guard: Self) -> T { - let _ = guard.on_drop; + guard.on_drop.take(); // Safety: we're about to forget the guard altogether let value = unsafe { ManuallyDrop::take(&mut guard.captured) }; std::mem::forget(guard);