fix some rkyv impls

This commit is contained in:
zyansheep 2022-07-11 22:36:52 -04:00
parent 446b52d08f
commit 7cc885e861
3 changed files with 13 additions and 5 deletions

View File

@ -27,11 +27,15 @@ use std::mem;
/// A array-based statically sized matrix data storage. /// A array-based statically sized matrix data storage.
#[repr(transparent)] #[repr(transparent)]
#[derive(Copy, Clone, PartialEq, Eq, Hash)] #[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr( #[cfg_attr(
feature = "rkyv-serialize-no-std", feature = "rkyv-serialize-no-std",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
archive(as = "Self", bound(archive = "
T: rkyv::Archive<Archived = T>,
[[T; R]; C]: rkyv::Archive<Archived = [[T; R]; C]>
"))
)] )]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct ArrayStorage<T, const R: usize, const C: usize>(pub [[T; R]; C]); pub struct ArrayStorage<T, const R: usize, const C: usize>(pub [[T; R]; C]);

View File

@ -150,11 +150,15 @@ pub type MatrixCross<T, R1, C1, R2, C2> =
/// some concrete types for `T` and a compatible data storage type `S`). /// some concrete types for `T` and a compatible data storage type `S`).
#[repr(C)] #[repr(C)]
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr( #[cfg_attr(
feature = "rkyv-serialize-no-std", feature = "rkyv-serialize-no-std",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize) derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize),
archive(as = "Self", bound(archive = "
S: rkyv::Archive<Archived = S>,
PhantomData<(T, R, C)>: rkyv::Archive<Archived = PhantomData<(T, R, C)>>
"))
)] )]
#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct Matrix<T, R, C, S> { pub struct Matrix<T, R, C, S> {
/// The data storage that contains all the matrix components. Disappointed? /// The data storage that contains all the matrix components. Disappointed?

View File

@ -77,7 +77,7 @@ an optimized set of tools for computer graphics and physics. Those features incl
unused_variables, unused_variables,
unused_mut, unused_mut,
unused_parens, unused_parens,
unused_qualifications, // unused_qualifications,
rust_2018_idioms, rust_2018_idioms,
rust_2018_compatibility, rust_2018_compatibility,
future_incompatible, future_incompatible,