diff --git a/src/lib.rs b/src/lib.rs index 033d72c2..2e3bda31 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -576,7 +576,7 @@ pub fn inv_rotate>(m: &M, v: &V) -> V { /// Rotates a copy of `m` by `amount` using `center` as the pivot point. #[inline(always)] -pub fn append_rotation_wrt_point, +pub fn append_rotation_wrt_point + Copy, AV, M: RotationWithTranslation>( m: &M, @@ -587,7 +587,7 @@ pub fn append_rotation_wrt_point, /// Rotates a copy of `m` by `amount` using `m.translation()` as the pivot point. #[inline(always)] -pub fn append_rotation_wrt_center, +pub fn append_rotation_wrt_center + Copy, AV, M: RotationWithTranslation>( m: &M, diff --git a/src/structs/dvec_macros.rs b/src/structs/dvec_macros.rs index 1e0adbdb..8ee1f762 100644 --- a/src/structs/dvec_macros.rs +++ b/src/structs/dvec_macros.rs @@ -250,9 +250,9 @@ macro_rules! dvec_impl( } } - impl + Zero> Neg<$dvec> for $dvec { + impl + Zero + Copy> Neg<$dvec> for $dvec { #[inline] - fn neg(&self) -> $dvec { + fn neg(self) -> $dvec { FromIterator::from_iter(self.as_slice().iter().map(|a| -*a)) } } diff --git a/src/structs/quat.rs b/src/structs/quat.rs index 1a92628a..464884f0 100644 --- a/src/structs/quat.rs +++ b/src/structs/quat.rs @@ -54,7 +54,7 @@ impl Quat { } } -impl> Quat { +impl + Copy> Quat { /// Replaces this quaternion by its conjugate. #[inline] pub fn conjugate(&mut self) { diff --git a/src/structs/rot.rs b/src/structs/rot.rs index cc5da36d..09ecea2a 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -18,7 +18,7 @@ pub struct Rot2 { submat: Mat2 } -impl> Rot2 { +impl + Copy> Rot2 { /// Builds a 2 dimensional rotation matrix from an angle in radian. pub fn new(angle: Vec1) -> Rot2 { let (sia, coa) = angle.x.sin_cos(); @@ -66,7 +66,7 @@ impl Rotation> for Rot2 { } } -impl> Rand for Rot2 { +impl + Copy> Rand for Rot2 { #[inline] fn rand(rng: &mut R) -> Rot2 { Rot2::new(rng.gen()) diff --git a/src/structs/spec/vec0.rs b/src/structs/spec/vec0.rs index c1864867..683b3e12 100644 --- a/src/structs/spec/vec0.rs +++ b/src/structs/spec/vec0.rs @@ -112,9 +112,9 @@ impl Sub> for vec::Vec0 { } } -impl> Neg> for vec::Vec0 { +impl + Copy> Neg> for vec::Vec0 { #[inline] - fn neg(&self) -> vec::Vec0 { + fn neg(self) -> vec::Vec0 { vec::Vec0 } } diff --git a/src/structs/vec_macros.rs b/src/structs/vec_macros.rs index 8f5aa036..f33e0644 100644 --- a/src/structs/vec_macros.rs +++ b/src/structs/vec_macros.rs @@ -480,9 +480,9 @@ macro_rules! scalar_div_impl( macro_rules! neg_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( - impl> Neg<$t> for $t { + impl + Copy> Neg<$t> for $t { #[inline] - fn neg(&self) -> $t { + fn neg(self) -> $t { $t::new(-self.$comp0 $(, -self.$compN )*) } } diff --git a/src/traits/geometry.rs b/src/traits/geometry.rs index 3ac68557..ac7306cc 100644 --- a/src/traits/geometry.rs +++ b/src/traits/geometry.rs @@ -82,7 +82,7 @@ pub trait Rotate { /// /// Those operations are automatically implemented in term of the `Rotation` and `Translation` /// traits. -pub trait RotationWithTranslation, AV>: Rotation + Translation { +pub trait RotationWithTranslation + Copy, AV>: Rotation + Translation { /// Applies a rotation centered on a specific point. /// /// # Arguments @@ -136,7 +136,7 @@ pub trait RotationWithTranslation, AV>: Rotation + Translation, AV, M: Rotation + Translation> RotationWithTranslation for M { +impl + Copy, AV, M: Rotation + Translation> RotationWithTranslation for M { } /// Trait of transformation having a rotation extractable as a rotation matrix. This can typically