From 8e8a87b667ad73f318da0d63b34a76169976c7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 29 Jun 2013 12:06:39 +0000 Subject: [PATCH] Fixes to work with the new compiler. --- src/adaptors/transform.rs | 10 +++++----- src/dvec.rs | 16 ++++++++-------- src/vec_impl.rs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/adaptors/transform.rs b/src/adaptors/transform.rs index 3aa2d3c8..5298599d 100644 --- a/src/adaptors/transform.rs +++ b/src/adaptors/transform.rs @@ -101,11 +101,11 @@ impl, V, _0> Translate for Transform { self.submat.inv_translate(v) } } -impl, Res: Translation> -Translatable> for Transform +impl + Translation> +Translatable> for Transform { #[inline] - fn translated(&self, t: &V) -> Transform + fn translated(&self, t: &V) -> Transform { Transform::new(copy self.submat, self.subtrans.translated(t)) } } @@ -146,7 +146,7 @@ impl, V, _0> Rotate for Transform } impl + One, - Res: Rotation + RMul, + Res: Rotation + RMul + One, V, AV> Rotatable> for Transform @@ -189,7 +189,7 @@ transformation::Transform for Transform // FIXME: constraints are too restrictive. // Should be: Transformable ... -impl + Mul, V: Add> +impl + Mul + Inv, V: Add + Neg> Transformable, Transform> for Transform { fn transformed(&self, t: &Transform) -> Transform diff --git a/src/dvec.rs b/src/dvec.rs index 00b38688..8673cce7 100644 --- a/src/dvec.rs +++ b/src/dvec.rs @@ -13,7 +13,7 @@ use traits::norm::Norm; use traits::translation::{Translation, Translatable}; use traits::scalar_op::{ScalarMul, ScalarDiv, ScalarAdd, ScalarSub}; -#[deriving(Eq, Ord, ToStr, Clone)] +#[deriving(Eq, Ord, ToStr)] pub struct DVec { at: ~[N] @@ -53,7 +53,7 @@ impl> FromIterator for DVec } // FIXME: is Clone needed? -impl> DVec +impl> DVec { pub fn canonical_basis_with_dim(dim: uint) -> ~[DVec] { @@ -87,7 +87,7 @@ impl> DVec if res.len() == dim - 1 { break; } - let mut elt = basis_element.clone(); + let mut elt = copy basis_element; elt = elt - self.scalar_mul(&basis_element.dot(self)); @@ -223,11 +223,11 @@ ScalarSub for DVec } } -impl + Neg> Translation> for DVec +impl + Neg> Translation> for DVec { #[inline] fn translation(&self) -> DVec - { self.clone() } + { copy *self } #[inline] fn inv_translation(&self) -> DVec @@ -238,14 +238,14 @@ impl + Neg> Translation> for DVec { *self = *self + *t; } } -impl + Copy> Translatable, DVec> for DVec +impl + Neg + Copy> Translatable, DVec> for DVec { #[inline] fn translated(&self, t: &DVec) -> DVec { self + *t } } -impl +impl Norm for DVec { #[inline] @@ -259,7 +259,7 @@ Norm for DVec #[inline] fn normalized(&self) -> DVec { - let mut res : DVec = self.clone(); + let mut res : DVec = copy *self; res.normalize(); diff --git a/src/vec_impl.rs b/src/vec_impl.rs index 37f3902a..7902cacd 100644 --- a/src/vec_impl.rs +++ b/src/vec_impl.rs @@ -309,7 +309,7 @@ macro_rules! translation_impl( macro_rules! translatable_impl( ($t: ident) => ( - impl + Copy> Translatable<$t, $t> for $t + impl + Neg + Copy> Translatable<$t, $t> for $t { #[inline] fn translated(&self, t: &$t) -> $t