From 81277a5533495ca4fb2846162e2d9ba99b602f89 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 30 Sep 2025 14:25:07 +0200 Subject: [PATCH] Replace unsafe unwrap with `expect` call --- src/function/execute.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/function/execute.rs b/src/function/execute.rs index 7445d2f81..c6df1a4a5 100644 --- a/src/function/execute.rs +++ b/src/function/execute.rs @@ -183,8 +183,10 @@ where debug_assert!(memo.may_be_provisional()); memo.value.as_ref() }; - // SAFETY: The `LRU` does not run mid-execution, so the value remains filled - let last_provisional_value = unsafe { last_provisional_value.unwrap_unchecked() }; + + let last_provisional_value = last_provisional_value.expect( + "`fetch_cold_cycle` should have inserted a provisional memo with Cycle::initial", + ); crate::tracing::debug!( "{database_key_index:?}: execute: \ I am a cycle head, comparing last provisional value with new value"