Get cargo check --all working

This commit is contained in:
Jonathan Kelley committed 2024-01-18 19:27:55 -08:00
1 parent d8af9b7ed1
commit 6ed3aafb2f
34 files changed
+80 -122

No files matched your search

+2 -2
View File
@@ -464,7 +464,7 @@ impl<T: 'static, S: Storage<SignalData<T>>> PartialEq for Signal<T, S> {
/// Allow calling a signal with signal() syntax
///
/// Currently only limited to copy types, though could probably specialize for string/arc/rc
impl<T: Copy, S: Storage<SignalData<T>> + 'static> Deref for Signal<T, S> {
impl<T: Clone, S: Storage<SignalData<T>> + 'static> Deref for Signal<T, S> {
type Target = dyn Fn() -> T;
fn deref(&self) -> &Self::Target {
@@ -473,7 +473,7 @@ impl<T: Copy, S: Storage<SignalData<T>> + 'static> Deref for Signal<T, S> {
// First we create a closure that captures something with the Same in memory layout as Self (MaybeUninit<Self>).
let uninit_callable = MaybeUninit::<Self>::uninit();
// Then move that value into the closure. We assume that the closure now has a in memory layout of Self.
let uninit_closure = move || *Self::read(unsafe { &*uninit_callable.as_ptr() });
let uninit_closure = move || Self::read(unsafe { &*uninit_callable.as_ptr() }).clone();
// Check that the size of the closure is the same as the size of Self in case the compiler changed the layout of the closure.
let size_of_closure = std::mem::size_of_val(&uninit_closure);