From 479cc7a7ff0a5c08bcad569ffb628224ab6d36a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 17 Apr 2016 17:38:13 +0200 Subject: [PATCH] Fix compilation when the "generic_sizes" feature is enabled. --- .travis.yml | 2 +- Makefile | 11 +++++++---- src/structs/vectorn.rs | 1 + src/structs/vectorn_macros.rs | 20 ++++++++++---------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8d82ad7..88f0886a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,5 @@ language: rust script: - rustc --version - cargo --version - - cargo build --verbose + - cargo build --verbose --features "arbitrary generic_sizes" - cargo test --verbose --features arbitrary diff --git a/Makefile b/Makefile index 31318000..87cc39fb 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,19 @@ tmp=_git_distcheck all: - cargo build --release --features arbitrary + cargo build --release --features "arbitrary generic_sizes" test: - cargo test + cargo test --features "arbitrary generic_sizes" + bench: - cargo bench + cargo bench --features "arbitrary generic_sizes" + doc: - cargo doc --no-deps + cargo doc --no-deps --features "arbitrary generic_sizes" + clean: cargo clean diff --git a/src/structs/vectorn.rs b/src/structs/vectorn.rs index 7b7e073b..9b0fec3e 100644 --- a/src/structs/vectorn.rs +++ b/src/structs/vectorn.rs @@ -120,4 +120,5 @@ impl> Arbitrary for Vect } } + vecn_dvec_common_impl!(VectorN, D); diff --git a/src/structs/vectorn_macros.rs b/src/structs/vectorn_macros.rs index ce202bb3..04b2b79a 100644 --- a/src/structs/vectorn_macros.rs +++ b/src/structs/vectorn_macros.rs @@ -163,7 +163,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl MulAssign<$vecn> for $vecn + impl)*> MulAssign<$vecn> for $vecn where N: Copy + MulAssign + Zero $(, $param : ArrayLength)* { #[inline] fn mul_assign(&mut self, right: $vecn) { @@ -175,7 +175,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl MulAssign for $vecn + impl)*> MulAssign for $vecn where N: Copy + MulAssign + Zero $(, $param : ArrayLength)* { #[inline] fn mul_assign(&mut self, right: N) { @@ -185,7 +185,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl<$($param : ArrayLength),*> Mul<$vecn> for f32 { + impl<$($param : ArrayLength),*> Mul<$vecn> for f32 { type Output = $vecn; #[inline] @@ -200,7 +200,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl<$($param : ArrayLength),*> Mul<$vecn> for f64 { + impl<$($param : ArrayLength),*> Mul<$vecn> for f64 { type Output = $vecn; #[inline] @@ -253,7 +253,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl DivAssign<$vecn> for $vecn + impl)*> DivAssign<$vecn> for $vecn where N: Copy + DivAssign + Zero $(, $param : ArrayLength)* { #[inline] fn div_assign(&mut self, right: $vecn) { @@ -265,7 +265,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl DivAssign for $vecn + impl)*> DivAssign for $vecn where N: Copy + DivAssign + Zero $(, $param : ArrayLength)* { #[inline] fn div_assign(&mut self, right: N) { @@ -313,7 +313,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl AddAssign<$vecn> for $vecn + impl)*> AddAssign<$vecn> for $vecn where N: Copy + AddAssign + Zero $(, $param : ArrayLength)* { #[inline] fn add_assign(&mut self, right: $vecn) { @@ -325,7 +325,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl AddAssign for $vecn + impl)*> AddAssign for $vecn where N: Copy + AddAssign + Zero $(, $param : ArrayLength)* { #[inline] fn add_assign(&mut self, right: N) { @@ -403,7 +403,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl SubAssign<$vecn> for $vecn + impl)*> SubAssign<$vecn> for $vecn where N: Copy + SubAssign + Zero $(, $param : ArrayLength)* { #[inline] fn sub_assign(&mut self, right: $vecn) { @@ -415,7 +415,7 @@ macro_rules! vecn_dvec_common_impl( } } - impl SubAssign for $vecn + impl)*> SubAssign for $vecn where N: Copy + SubAssign + Zero $(, $param : ArrayLength)* { #[inline] fn sub_assign(&mut self, right: N) {