From 39fd7c1ae7d0792b4cc6e9931d9d9d3a5e654e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 1 Feb 2015 16:15:55 +0100 Subject: [PATCH] Silence warnings and replace `Show` by `Debug`. --- src/lib.rs | 5 ++++- src/structs/dvec.rs | 2 +- src/structs/iso.rs | 6 +++--- src/structs/mat.rs | 14 +++++++------- src/structs/ortho.rs | 4 ++-- src/structs/persp.rs | 4 ++-- src/structs/pnt.rs | 14 +++++++------- src/structs/quat.rs | 4 ++-- src/structs/rot.rs | 6 +++--- src/structs/vec.rs | 14 +++++++------- src/traits/operations.rs | 2 +- 11 files changed, 39 insertions(+), 36 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 19818387..274a0ca7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,9 +81,12 @@ Feel free to add your project to this list if you happen to use **nalgebra**! #![deny(non_upper_case_globals)] #![deny(unused_qualifications)] #![deny(unused_results)] - #![allow(unstable)] #![warn(missing_docs)] #![feature(unboxed_closures)] +#![feature(rand)] +#![feature(hash)] +#![feature(core)] +#![feature(std_misc)] #![doc(html_root_url = "http://nalgebra.org/doc")] extern crate "rustc-serialize" as rustc_serialize; diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index fc8b239f..3c93faf6 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -15,7 +15,7 @@ use traits::structure::{Iterable, IterableMut, Indexable, Shape, BaseFloat, Base use quickcheck::{Arbitrary, Gen}; /// Heap allocated, dynamically sized vector. -#[derive(Eq, PartialEq, Show, Clone)] +#[derive(Eq, PartialEq, Debug, Clone)] pub struct DVec { /// Components of the vector. Contains as much elements as the vector dimension. pub at: Vec diff --git a/src/structs/iso.rs b/src/structs/iso.rs index 0dbf768f..78556835 100644 --- a/src/structs/iso.rs +++ b/src/structs/iso.rs @@ -23,7 +23,7 @@ use quickcheck::{Arbitrary, Gen}; /// /// This is the composition of a rotation followed by a translation. /// Isometries conserve angles and distances, hence do not allow shearing nor scaling. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Copy)] pub struct Iso2 { /// The rotation applicable by this isometry. pub rotation: Rot2, @@ -35,7 +35,7 @@ pub struct Iso2 { /// /// This is the composition of a rotation followed by a translation. /// Isometries conserve angles and distances, hence do not allow shearing nor scaling. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Copy)] pub struct Iso3 { /// The rotation applicable by this isometry. pub rotation: Rot3, @@ -46,7 +46,7 @@ pub struct Iso3 { /// Four dimensional isometry. /// /// Isometries conserve angles and distances, hence do not allow shearing nor scaling. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Copy)] pub struct Iso4 { /// The rotation applicable by this isometry. pub rotation: Rot4, diff --git a/src/structs/mat.rs b/src/structs/mat.rs index 5c106c7b..c3e8ece5 100644 --- a/src/structs/mat.rs +++ b/src/structs/mat.rs @@ -20,7 +20,7 @@ use quickcheck::{Arbitrary, Gen}; /// Special identity matrix. All its operation are no-ops. -#[derive(Eq, PartialEq, RustcDecodable, Clone, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcDecodable, Clone, Rand, Debug, Copy)] pub struct Identity; impl Identity { @@ -32,7 +32,7 @@ impl Identity { } /// Square matrix of dimension 1. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Mat1 { pub m11: N } @@ -77,7 +77,7 @@ eigen_qr_impl!(Mat1, Vec1); arbitrary_impl!(Mat1, m11); /// Square matrix of dimension 2. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Mat2 { pub m11: N, pub m21: N, pub m12: N, pub m22: N @@ -126,7 +126,7 @@ eigen_qr_impl!(Mat2, Vec2); arbitrary_impl!(Mat2, m11, m12, m21, m22); /// Square matrix of dimension 3. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Mat3 { pub m11: N, pub m21: N, pub m31: N, pub m12: N, pub m22: N, pub m32: N, @@ -213,7 +213,7 @@ arbitrary_impl!(Mat3, ); /// Square matrix of dimension 4. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Mat4 { pub m11: N, pub m21: N, pub m31: N, pub m41: N, pub m12: N, pub m22: N, pub m32: N, pub m42: N, @@ -319,7 +319,7 @@ arbitrary_impl!(Mat4, ); /// Square matrix of dimension 5. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Mat5 { pub m11: N, pub m21: N, pub m31: N, pub m41: N, pub m51: N, pub m12: N, pub m22: N, pub m32: N, pub m42: N, pub m52: N, @@ -440,7 +440,7 @@ arbitrary_impl!(Mat5, ); /// Square matrix of dimension 6. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Mat6 { pub m11: N, pub m21: N, pub m31: N, pub m41: N, pub m51: N, pub m61: N, pub m12: N, pub m22: N, pub m32: N, pub m42: N, pub m52: N, pub m62: N, diff --git a/src/structs/ortho.rs b/src/structs/ortho.rs index 238905e5..19b38e84 100644 --- a/src/structs/ortho.rs +++ b/src/structs/ortho.rs @@ -9,7 +9,7 @@ use quickcheck::{Arbitrary, Gen}; /// A 3D orthographic projection stored without any matrix. /// /// Reading or modifying its individual properties is cheap but applying the transformation is costly. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Copy)] pub struct Ortho3 { width: N, height: N, @@ -20,7 +20,7 @@ pub struct Ortho3 { /// A 3D orthographic projection stored as a 4D matrix. /// /// Reading or modifying its individual properties is costly but applying the transformation is cheap. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Copy)] pub struct OrthoMat3 { mat: Mat4 } diff --git a/src/structs/persp.rs b/src/structs/persp.rs index 2e03d69b..af9289cd 100644 --- a/src/structs/persp.rs +++ b/src/structs/persp.rs @@ -8,7 +8,7 @@ use quickcheck::{Arbitrary, Gen}; /// A 3D perspective projection stored without any matrix. /// /// Reading or modifying its individual properties is cheap but applying the transformation is costly. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Copy)] pub struct Persp3 { aspect: N, fov: N, @@ -19,7 +19,7 @@ pub struct Persp3 { /// A 3D perspective projection stored as a 4D matrix. /// /// Reading or modifying its individual properties is costly but applying the transformation is cheap. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Copy)] pub struct PerspMat3 { mat: Mat4 } diff --git a/src/structs/pnt.rs b/src/structs/pnt.rs index 8902554c..aec3e948 100644 --- a/src/structs/pnt.rs +++ b/src/structs/pnt.rs @@ -17,7 +17,7 @@ use quickcheck::{Arbitrary, Gen}; /// Point of dimension 0. -#[derive(Eq, PartialEq, RustcDecodable, Clone, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcDecodable, Clone, Rand, Debug, Copy)] pub struct Pnt0; impl Pnt0 { @@ -35,7 +35,7 @@ impl Pnt0 { } /// Point of dimension 1. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Pnt1 { /// First component of the point. pub x: N @@ -74,7 +74,7 @@ num_float_pnt_impl!(Pnt1, Vec1); arbitrary_pnt_impl!(Pnt1, x); /// Point of dimension 2. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Pnt2 { /// First component of the point. pub x: N, @@ -115,7 +115,7 @@ num_float_pnt_impl!(Pnt2, Vec2); arbitrary_pnt_impl!(Pnt2, x, y); /// Point of dimension 3. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Pnt3 { /// First component of the point. pub x: N, @@ -158,7 +158,7 @@ num_float_pnt_impl!(Pnt3, Vec3); arbitrary_pnt_impl!(Pnt3, x, y, z); /// Point of dimension 4. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Pnt4 { /// First component of the point. pub x: N, @@ -203,7 +203,7 @@ num_float_pnt_impl!(Pnt4, Vec4); arbitrary_pnt_impl!(Pnt4, x, y, z, w); /// Point of dimension 5. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Pnt5 { /// First component of the point. pub x: N, @@ -250,7 +250,7 @@ num_float_pnt_impl!(Pnt5, Vec5); arbitrary_pnt_impl!(Pnt5, x, y, z, w, a); /// Point of dimension 6. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Pnt6 { /// First component of the point. pub x: N, diff --git a/src/structs/quat.rs b/src/structs/quat.rs index 5fb4cb4c..eaf0fa40 100644 --- a/src/structs/quat.rs +++ b/src/structs/quat.rs @@ -20,7 +20,7 @@ use quickcheck::{Arbitrary, Gen}; /// A quaternion. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Quat { /// The scalar component of the quaternion. pub w: N, @@ -152,7 +152,7 @@ impl + BaseFloat> Div> for Quat { /// A unit quaternion that can represent a 3D rotation. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Debug, Copy)] pub struct UnitQuat { q: Quat } diff --git a/src/structs/rot.rs b/src/structs/rot.rs index 34c38443..462eaf25 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -16,7 +16,7 @@ use quickcheck::{Arbitrary, Gen}; /// Two dimensional rotation matrix. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Hash, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Hash, Copy)] pub struct Rot2 { submat: Mat2 } @@ -101,7 +101,7 @@ impl> Arbitrary for Rot2 { * 3d rotation */ /// Three dimensional rotation matrix. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Hash, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Hash, Copy)] pub struct Rot3 { submat: Mat3 } @@ -306,7 +306,7 @@ impl Arbitrary for Rot3 { /// Four dimensional rotation matrix. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Hash, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Hash, Copy)] pub struct Rot4 { submat: Mat4 } diff --git a/src/structs/vec.rs b/src/structs/vec.rs index 337c1f4d..96aca6b4 100644 --- a/src/structs/vec.rs +++ b/src/structs/vec.rs @@ -19,7 +19,7 @@ use quickcheck::{Arbitrary, Gen}; /// Vector of dimension 0. -#[derive(Eq, PartialEq, RustcDecodable, Clone, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcDecodable, Clone, Rand, Debug, Copy)] pub struct Vec0; impl Vec0 { @@ -37,7 +37,7 @@ impl Vec0 { } /// Vector of dimension 1. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Vec1 { /// First component of the vector. pub x: N @@ -87,7 +87,7 @@ absolute_vec_impl!(Vec1, x); arbitrary_impl!(Vec1, x); /// Vector of dimension 2. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Vec2 { /// First component of the vector. pub x: N, @@ -139,7 +139,7 @@ absolute_vec_impl!(Vec2, x, y); arbitrary_impl!(Vec2, x, y); /// Vector of dimension 3. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Vec3 { /// First component of the vector. pub x: N, @@ -194,7 +194,7 @@ arbitrary_impl!(Vec3, x, y, z); /// Vector of dimension 4. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Vec4 { /// First component of the vector. pub x: N, @@ -250,7 +250,7 @@ absolute_vec_impl!(Vec4, x, y, z, w); arbitrary_impl!(Vec4, x, y, z, w); /// Vector of dimension 5. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Vec5 { /// First component of the vector. pub x: N, @@ -308,7 +308,7 @@ absolute_vec_impl!(Vec5, x, y, z, w, a); arbitrary_impl!(Vec5, x, y, z, w, a); /// Vector of dimension 6. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Hash, Rand, Debug, Copy)] pub struct Vec6 { /// First component of the vector. pub x: N, diff --git a/src/traits/operations.rs b/src/traits/operations.rs index 1c58f390..248d3046 100644 --- a/src/traits/operations.rs +++ b/src/traits/operations.rs @@ -6,7 +6,7 @@ use std::cmp::Ordering; use traits::structure::SquareMat; /// Result of a partial ordering. -#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Show, Copy)] +#[derive(Eq, PartialEq, RustcEncodable, RustcDecodable, Clone, Debug, Copy)] pub enum POrdering { /// Result of a strict comparison. PartialLess,