diff --git a/src/base/array_storage.rs b/src/base/array_storage.rs index 457fa35e..5c165399 100644 --- a/src/base/array_storage.rs +++ b/src/base/array_storage.rs @@ -30,10 +30,13 @@ use std::mem; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "ArrayStorage", bound(archive = " + archive( + as = "ArrayStorage", + 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))] diff --git a/src/base/matrix.rs b/src/base/matrix.rs index 531b0540..fac84963 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -12,7 +12,7 @@ use std::mem; use serde::{Deserialize, Deserializer, Serialize, Serializer}; #[cfg(feature = "rkyv-serialize-no-std")] -use rkyv::{Archive, Archived, with::With}; +use rkyv::{with::With, Archive, Archived}; #[cfg(feature = "rkyv-serialize-no-std")] use rkyv_wrappers::custom_phantom::CustomPhantom; @@ -158,11 +158,14 @@ pub type MatrixCross = #[cfg_attr( feature = "rkyv-serialize-no-std", derive(Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Matrix", bound(archive = " + archive( + as = "Matrix", + bound(archive = " T: Archive, S: Archive, With, CustomPhantom<(Archived, R, C)>>: Archive, R, C)>> - ")) + ") + ) )] #[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] diff --git a/src/base/unit.rs b/src/base/unit.rs index 27588af0..2fc51107 100644 --- a/src/base/unit.rs +++ b/src/base/unit.rs @@ -24,9 +24,12 @@ use crate::{Dim, Matrix, OMatrix, RealField, Scalar, SimdComplexField, SimdRealF #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Unit", bound(archive = " + archive( + as = "Unit", + bound(archive = " T: rkyv::Archive, - ")) + ") + ) )] #[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] // #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] diff --git a/src/geometry/dual_quaternion.rs b/src/geometry/dual_quaternion.rs index 1d488d83..3219ad7c 100644 --- a/src/geometry/dual_quaternion.rs +++ b/src/geometry/dual_quaternion.rs @@ -44,10 +44,13 @@ use simba::scalar::{ClosedNeg, RealField}; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "DualQuaternion", bound(archive = " + archive( + as = "DualQuaternion", + bound(archive = " T: rkyv::Archive, Quaternion: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] pub struct DualQuaternion { diff --git a/src/geometry/isometry.rs b/src/geometry/isometry.rs index 214f9e90..ca2aeb6d 100755 --- a/src/geometry/isometry.rs +++ b/src/geometry/isometry.rs @@ -69,11 +69,14 @@ use crate::geometry::{AbstractRotation, Point, Translation}; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Isometry", bound(archive = " + archive( + as = "Isometry", + bound(archive = " T: rkyv::Archive, R: rkyv::Archive, Translation: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] pub struct Isometry { diff --git a/src/geometry/orthographic.rs b/src/geometry/orthographic.rs index acd2d02c..dc45564c 100644 --- a/src/geometry/orthographic.rs +++ b/src/geometry/orthographic.rs @@ -23,10 +23,13 @@ use crate::geometry::{Point3, Projective3}; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Orthographic3", bound(archive = " + archive( + as = "Orthographic3", + bound(archive = " T: rkyv::Archive, Matrix4: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] #[derive(Copy, Clone)] diff --git a/src/geometry/perspective.rs b/src/geometry/perspective.rs index 1c5e2ec9..9b88c0c3 100644 --- a/src/geometry/perspective.rs +++ b/src/geometry/perspective.rs @@ -24,10 +24,13 @@ use crate::geometry::{Point3, Projective3}; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Perspective3", bound(archive = " + archive( + as = "Perspective3", + bound(archive = " T: rkyv::Archive, Matrix4: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] #[derive(Copy, Clone)] diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index ece0346e..49764802 100755 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -27,10 +27,13 @@ use crate::geometry::{Point3, Rotation}; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Quaternion", bound(archive = " + archive( + as = "Quaternion", + bound(archive = " T: rkyv::Archive, Vector4: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] pub struct Quaternion { diff --git a/src/geometry/rotation.rs b/src/geometry/rotation.rs index a923af8b..d02e2259 100755 --- a/src/geometry/rotation.rs +++ b/src/geometry/rotation.rs @@ -53,10 +53,13 @@ use crate::geometry::Point; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Rotation", bound(archive = " + archive( + as = "Rotation", + bound(archive = " T: rkyv::Archive, SMatrix: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] #[derive(Copy, Clone)] diff --git a/src/geometry/scale.rs b/src/geometry/scale.rs index 6dd0ce39..be3c6f70 100755 --- a/src/geometry/scale.rs +++ b/src/geometry/scale.rs @@ -21,10 +21,13 @@ use crate::geometry::Point; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Scale", bound(archive = " + archive( + as = "Scale", + bound(archive = " T: rkyv::Archive, SVector: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] #[derive(Copy, Clone)] diff --git a/src/geometry/similarity.rs b/src/geometry/similarity.rs index 6c7d5418..b2ce1e1c 100755 --- a/src/geometry/similarity.rs +++ b/src/geometry/similarity.rs @@ -37,11 +37,14 @@ use crate::geometry::{AbstractRotation, Isometry, Point, Translation}; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Similarity", bound(archive = " + archive( + as = "Similarity", + bound(archive = " T: rkyv::Archive, R: rkyv::Archive, Isometry: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] pub struct Similarity { diff --git a/src/geometry/translation.rs b/src/geometry/translation.rs index 980b885f..403a9a6a 100755 --- a/src/geometry/translation.rs +++ b/src/geometry/translation.rs @@ -21,10 +21,13 @@ use crate::geometry::Point; #[cfg_attr( feature = "rkyv-serialize-no-std", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize), - archive(as = "Translation", bound(archive = " + archive( + as = "Translation", + bound(archive = " T: rkyv::Archive, SVector: rkyv::Archive> - ")) + ") + ) )] #[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))] #[derive(Copy, Clone)] diff --git a/src/lib.rs b/src/lib.rs index 13557887..780b03e8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -83,7 +83,11 @@ an optimized set of tools for computer graphics and physics. Those features incl missing_copy_implementations )] #![cfg_attr(feature = "rkyv-serialize-no-std", allow(unused_results))] // TODO: deny this once bytecheck stops generating warnings. -#![cfg_attr(not(feature = "rkyv-serialize-no-std"), deny(unused_results), deny(unused_qualifications))] // TODO: deny this globally +#![cfg_attr( + not(feature = "rkyv-serialize-no-std"), + deny(unused_results), + deny(unused_qualifications) +)] // TODO: deny this globally #![doc( html_favicon_url = "https://nalgebra.org/img/favicon.ico", html_root_url = "https://docs.rs/nalgebra/0.25.0" diff --git a/tests/core/mod.rs b/tests/core/mod.rs index d4504c83..01cc34e3 100644 --- a/tests/core/mod.rs +++ b/tests/core/mod.rs @@ -7,8 +7,8 @@ mod matrix; mod matrix_slice; #[cfg(feature = "mint")] mod mint; -mod serde; mod rkyv; +mod serde; #[cfg(feature = "compare")] mod matrixcompare; diff --git a/tests/core/rkyv.rs b/tests/core/rkyv.rs index 7e2da7aa..12d85f56 100644 --- a/tests/core/rkyv.rs +++ b/tests/core/rkyv.rs @@ -6,7 +6,7 @@ use na::{ SimilarityMatrix3, Translation2, Translation3, Unit, Vector2, }; use rand; -use rkyv::{Archive, Serialize, Deserialize, Infallible}; +use rkyv::{Archive, Deserialize, Infallible, Serialize}; macro_rules! test_rkyv_archived_impls( ($($test: ident, $ty: ident);* $(;)*) => {$( @@ -56,4 +56,4 @@ test_rkyv!( rkyv_isometry_matrix2, IsometryMatrix2; rkyv_similarity2, Similarity2; rkyv_similarity_matrix2, SimilarityMatrix2; */ -); \ No newline at end of file +);