diff --git a/src/base/array_storage.rs b/src/base/array_storage.rs index 3bc71e1a..cd534baa 100644 --- a/src/base/array_storage.rs +++ b/src/base/array_storage.rs @@ -27,11 +27,15 @@ use std::mem; /// A array-based statically sized matrix data storage. #[repr(transparent)] #[derive(Copy, Clone, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] #[cfg_attr( 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, + [[T; R]; C]: rkyv::Archive + ")) )] +#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] pub struct ArrayStorage(pub [[T; R]; C]); diff --git a/src/base/matrix.rs b/src/base/matrix.rs index 8f8786c1..5eb58737 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -150,11 +150,15 @@ pub type MatrixCross = /// some concrete types for `T` and a compatible data storage type `S`). #[repr(C)] #[derive(Clone, Copy)] -#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] #[cfg_attr( 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, + PhantomData<(T, R, C)>: rkyv::Archive> + ")) )] +#[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] pub struct Matrix { /// The data storage that contains all the matrix components. Disappointed? diff --git a/src/lib.rs b/src/lib.rs index 1ee1a3ba..028dac38 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -77,7 +77,7 @@ an optimized set of tools for computer graphics and physics. Those features incl unused_variables, unused_mut, unused_parens, - unused_qualifications, + // unused_qualifications, rust_2018_idioms, rust_2018_compatibility, future_incompatible,