Update to the last Rust.

Version of rustc: 0.11-pre (eea4909 2014-04-24 23:41:15 -0700)
Vector do not implement `Rand` anymore.
This commit is contained in:
Sébastien Crozet 2014-04-25 20:28:05 +02:00
parent 1eed234e08
commit 7ef933aefb
4 changed files with 3 additions and 35 deletions

View File

@ -35,7 +35,7 @@ impl<N: Float + Num + Clone>
Rotation<Vec1<N>> for Rot2<N> {
#[inline]
fn rotation(&self) -> Vec1<N> {
Vec1::new((-self.submat.m12).atan2(&self.submat.m11))
Vec1::new((-self.submat.m12).atan2(self.submat.m11.clone()))
}
#[inline]

View File

@ -103,7 +103,6 @@ scalar_sub_impl!(Vec1, int, Vec1SubRhs, x)
translation_impl!(Vec1)
norm_impl!(Vec1, x)
approx_eq_impl!(Vec1, x)
round_impl!(Vec1, x)
one_impl!(Vec1, x)
from_iterator_impl!(Vec1, iterator)
bounded_impl!(Vec1, x)
@ -201,7 +200,6 @@ scalar_sub_impl!(Vec2, int, Vec2SubRhs, x, y)
translation_impl!(Vec2)
norm_impl!(Vec2, x, y)
approx_eq_impl!(Vec2, x, y)
round_impl!(Vec2, x, y)
one_impl!(Vec2, x, y)
from_iterator_impl!(Vec2, iterator, iterator)
bounded_impl!(Vec2, x, y)
@ -304,7 +302,6 @@ scalar_sub_impl!(Vec3, int, Vec3SubRhs, x, y, z)
translation_impl!(Vec3)
norm_impl!(Vec3, x, y ,z)
approx_eq_impl!(Vec3, x, y, z)
round_impl!(Vec3, x, y, z)
one_impl!(Vec3, x, y, z)
from_iterator_impl!(Vec3, iterator, iterator, iterator)
bounded_impl!(Vec3, x, y, z)
@ -407,7 +404,6 @@ scalar_sub_impl!(Vec4, int, Vec4SubRhs, x, y, z, w)
translation_impl!(Vec4)
norm_impl!(Vec4, x, y, z, w)
approx_eq_impl!(Vec4, x, y, z, w)
round_impl!(Vec4, x, y, z, w)
one_impl!(Vec4, x, y, z, w)
from_iterator_impl!(Vec4, iterator, iterator, iterator, iterator)
bounded_impl!(Vec4, x, y, z, w)
@ -511,7 +507,6 @@ scalar_sub_impl!(Vec5, int, Vec5SubRhs, x, y, z, w, a)
translation_impl!(Vec5)
norm_impl!(Vec5, x, y, z, w, a)
approx_eq_impl!(Vec5, x, y, z, w, a)
round_impl!(Vec5, x, y, z, w, a)
one_impl!(Vec5, x, y, z, w, a)
from_iterator_impl!(Vec5, iterator, iterator, iterator, iterator, iterator)
bounded_impl!(Vec5, x, y, z, w, a)
@ -617,7 +612,6 @@ scalar_sub_impl!(Vec6, int, Vec6SubRhs, x, y, z, w, a, b)
translation_impl!(Vec6)
norm_impl!(Vec6, x, y, z, w, a, b)
approx_eq_impl!(Vec6, x, y, z, w, a, b)
round_impl!(Vec6, x, y, z, w, a, b)
one_impl!(Vec6, x, y, z, w, a, b)
from_iterator_impl!(Vec6, iterator, iterator, iterator, iterator, iterator, iterator)
bounded_impl!(Vec6, x, y, z, w, a, b)

View File

@ -493,32 +493,6 @@ macro_rules! norm_impl(
)
)
macro_rules! round_impl(
($t: ident, $comp0: ident $(,$compN: ident)*) => (
impl<N: Round> Round for $t<N> {
fn floor(&self) -> $t<N> {
$t::new(self.$comp0.floor() $(, self.$compN.floor())*)
}
fn ceil(&self) -> $t<N> {
$t::new(self.$comp0.ceil() $(, self.$compN.ceil())*)
}
fn round(&self) -> $t<N> {
$t::new(self.$comp0.round() $(, self.$compN.round())*)
}
fn trunc(&self) -> $t<N> {
$t::new(self.$comp0.trunc() $(, self.$compN.trunc())*)
}
fn fract(&self) -> $t<N> {
$t::new(self.$comp0.fract() $(, self.$compN.fract())*)
}
}
)
)
macro_rules! approx_eq_impl(
($t: ident, $comp0: ident $(,$compN: ident)*) => (
impl<N: ApproxEq<N>> ApproxEq<N> for $t<N> {

View File

@ -39,7 +39,7 @@ pub trait VecExt<N>: AnyVec<N> + Indexable<uint, N> + Iterable<N> +
/// Trait grouping uncommon, low-level and borderline (from the mathematical point of view)
/// operations on vectors.
pub trait FloatVecExt<N: Float>: FloatVec<N> + VecExt<N> + Basis + Round { }
pub trait FloatVecExt<N: Float>: FloatVec<N> + VecExt<N> + Basis { }
impl<N, V: Dim + Sub<V, V> + Add<V, V> + Neg<V> + Zero + Eq + Mul<N, V> + Div<N, V> + Dot<N>>
AnyVec<N> for V { }
@ -51,7 +51,7 @@ impl<N,
UniformSphereSample + ScalarAdd<N> + ScalarSub<N> + Bounded>
VecExt<N> for V { }
impl<N: Float, V: FloatVec<N> + VecExt<N> + Basis + Round> FloatVecExt<N> for V { }
impl<N: Float, V: FloatVec<N> + VecExt<N> + Basis> FloatVecExt<N> for V { }
// FIXME: return an iterator instead
/// Traits of objects which can form a basis (typically vectors).