Revert breaking commit: https://github.com/matklad/once_cell/commit/8e47e43a49aa3b818837ad5f9b70da104b0755fa --- .home/.cargo/macports/once_cell-1.14.0/src/lib.rs 2006-07-24 09:21:28.000000000 +0800 +++ .home/.cargo/macports/once_cell-1.14.0/src/lib.rs 2026-01-05 06:43:16.000000000 +0800 @@ -348,9 +348,11 @@ cell::{Cell, UnsafeCell}, fmt, hint, mem, ops::{Deref, DerefMut}, - panic::{RefUnwindSafe, UnwindSafe}, }; + #[cfg(feature = "std")] + use std::panic::{RefUnwindSafe, UnwindSafe}; + /// A cell which can be written to only once. It is not thread safe. /// /// Unlike [`std::cell::RefCell`], a `OnceCell` provides simple `&` @@ -380,7 +382,9 @@ // `&unsync::OnceCell` to sneak a `T` through `catch_unwind`, // by initializing the cell in closure and extracting the value in the // `Drop`. + #[cfg(feature = "std")] impl RefUnwindSafe for OnceCell {} + #[cfg(feature = "std")] impl UnwindSafe for OnceCell {} impl Default for OnceCell { @@ -676,6 +680,7 @@ init: Cell>, } + #[cfg(feature = "std")] impl RefUnwindSafe for Lazy where OnceCell: RefUnwindSafe {} impl fmt::Debug for Lazy { @@ -1220,6 +1225,7 @@ unsafe impl Sync for Lazy where OnceCell: Sync {} // auto-derived `Send` impl is OK. + #[cfg(feature = "std")] impl RefUnwindSafe for Lazy where OnceCell: RefUnwindSafe {} impl Lazy {