From fc918ea68d536fa9f219e7b4decdae1f561c9886 Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Sat, 14 Sep 2024 23:09:18 -0500 Subject: Fix ICE. --- crates/utils/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/utils/src/lib.rs') diff --git a/crates/utils/src/lib.rs b/crates/utils/src/lib.rs index c6681d9..1e8ddfb 100644 --- a/crates/utils/src/lib.rs +++ b/crates/utils/src/lib.rs @@ -134,11 +134,11 @@ impl_FromEndianBytes!(i8, i16, i32, i64, isize, u8, u16, u32, u64, usize); /// Runs the body block the first time it is encountered. #[macro_export] macro_rules! first_time { - ($($stmt:stmt);*) => {{ - use core::cell::LazyCell; - static LAZY_CELL = LazyCell::new(|| { - $($stmt);* + ($($stmt:stmt)*) => {{ + use spin::lazy::Lazy; + static LAZY: Lazy<()> = Lazy::new(|| { + $($stmt)* }); - let _: &() = core::cell::LazyCell::force(&LAZY_CELL); + *Lazy::force(&LAZY) }}; } -- cgit v1.2.3