diff --git a/tcw3/pal/src/testing/eventloop.rs b/tcw3/pal/src/testing/eventloop.rs index 07e2c867..5847b64d 100644 --- a/tcw3/pal/src/testing/eventloop.rs +++ b/tcw3/pal/src/testing/eventloop.rs @@ -11,12 +11,13 @@ use std::{ }; use super::Wm; -use crate::{prelude::*, MtLock}; +use crate::{MtLock, MtSticky}; -mt_lazy_static! { - static ref UNSEND_DISPATCHES: RefCell>> => - |_| RefCell::new(LinkedList::new()); -} +static UNSEND_DISPATCHES: MtSticky>>> = { + // This is safe because the created value does not contain an actual + // unsendable content (`Box`) yet + unsafe { MtSticky::new_unchecked(RefCell::new(LinkedList::new())) } +}; static DISPATCH_RECV: MtLock>>> = MtLock::new(RefCell::new(None));