diff --git a/src/geometry/isometry.rs b/src/geometry/isometry.rs index 2e4b7cd5..a4e16abe 100755 --- a/src/geometry/isometry.rs +++ b/src/geometry/isometry.rs @@ -82,21 +82,23 @@ where } } -impl + Copy> Copy - for Isometry +impl Copy for Isometry where DefaultAllocator: Allocator, Owned: Copy, { } -impl + Clone> Clone for Isometry +impl Clone for Isometry where DefaultAllocator: Allocator, { #[inline] fn clone(&self) -> Self { - Self::from_parts(self.translation.clone(), self.rotation.clone()) + Self { + rotation: self.rotation.clone(), + translation: self.translation.clone(), + } } } diff --git a/src/geometry/isometry_alias.rs b/src/geometry/isometry_alias.rs index ba9a69e7..69d33cb4 100644 --- a/src/geometry/isometry_alias.rs +++ b/src/geometry/isometry_alias.rs @@ -13,3 +13,15 @@ pub type IsometryMatrix2 = Isometry>; /// A 3-dimensional direct isometry using a rotation matrix for its rotational part. Also known as a rigid-body motion, or as an element of SE(3). pub type IsometryMatrix3 = Isometry>; + +// This tests that the types correctly implement `Copy`, without having to run tests +// (when targeting no-std for example). +#[allow(dead_code)] +fn ensure_copy() { + fn is_copy() {} + + is_copy::>(); + is_copy::>(); + is_copy::>(); + is_copy::>(); +}