diff --git a/src/lib.rs b/src/lib.rs index 35f60bb5..3650a4d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -98,16 +98,16 @@ Feel free to add your project to this list if you happen to use **nalgebra**! * [frog](https://github.com/natal/frog): a machine learning library. */ -#[crate_id = "nalgebra#0.1"]; -#[crate_type = "lib"]; -#[deny(non_camel_case_types)]; -#[deny(unnecessary_parens)]; -#[deny(non_uppercase_statics)]; -#[deny(unnecessary_qualification)]; -#[deny(unused_result)]; -#[warn(missing_doc)]; -#[feature(macro_rules)]; -#[doc(html_root_url = "http://www.rust-ci.org/sebcrozet/nalgebra/doc")]; +#![crate_id = "nalgebra#0.1"] +#![crate_type = "lib"] +#![deny(non_camel_case_types)] +#![deny(unnecessary_parens)] +#![deny(non_uppercase_statics)] +#![deny(unnecessary_qualification)] +#![deny(unused_result)] +#![warn(missing_doc)] +#![feature(macro_rules)] +#![doc(html_root_url = "http://www.rust-ci.org/sebcrozet/nalgebra/doc")] extern crate std; extern crate rand; diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index c3dda7b3..83d36a39 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -1,6 +1,6 @@ //! Matrix with dimensions unknown at compile-time. -#[allow(missing_doc)]; // we hide doc to not have to document the $trhs double dispatch trait. +#![allow(missing_doc)] // we hide doc to not have to document the $trhs double dispatch trait. use rand::Rand; use rand; @@ -17,9 +17,9 @@ mod metal; /// Matrix with dimensions unknown at compile-time. #[deriving(TotalEq, Eq, Clone)] pub struct DMat { - priv nrows: uint, - priv ncols: uint, - priv mij: Vec + nrows: uint, + ncols: uint, + mij: Vec } double_dispatch_binop_decl_trait!(DMat, DMatMulRhs) diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index f08713b6..b45a1a47 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -1,6 +1,6 @@ //! Vector with dimensions unknown at compile-time. -#[allow(missing_doc)]; // we hide doc to not have to document the $trhs double dispatch trait. +#![allow(missing_doc)] // we hide doc to not have to document the $trhs double dispatch trait. use std::num::{Zero, One, Float}; use rand::Rand; @@ -18,7 +18,7 @@ mod metal; #[deriving(TotalEq, Eq, Show, Clone)] pub struct DVec { /// Components of the vector. Contains as much elements as the vector dimension. - at: Vec + pub at: Vec } double_dispatch_binop_decl_trait!(DVec, DVecMulRhs) @@ -161,7 +161,7 @@ impl IterableMut for DVec { impl FromIterator for DVec { #[inline] - fn from_iterator>(mut param: I) -> DVec { + fn from_iter>(mut param: I) -> DVec { let mut res = DVec { at: Vec::new() }; for e in param { diff --git a/src/structs/iso.rs b/src/structs/iso.rs index 95029b0e..b586e548 100644 --- a/src/structs/iso.rs +++ b/src/structs/iso.rs @@ -1,6 +1,6 @@ //! Isometric transformations. -#[allow(missing_doc)]; +#![allow(missing_doc)] use std::num::{Zero, One}; use rand::{Rand, Rng}; diff --git a/src/structs/iso_macros.rs b/src/structs/iso_macros.rs index 98e6cd99..43c05edb 100644 --- a/src/structs/iso_macros.rs +++ b/src/structs/iso_macros.rs @@ -1,4 +1,4 @@ -#[macro_escape]; +#![macro_escape] macro_rules! iso_impl( ($t: ident, $submat: ident, $subvec: ident, $subrotvec: ident) => ( diff --git a/src/structs/mat.rs b/src/structs/mat.rs index 903cb1ad..c17831cf 100644 --- a/src/structs/mat.rs +++ b/src/structs/mat.rs @@ -1,6 +1,6 @@ //! Matrices with dimensions known at compile-time. -#[allow(missing_doc)]; // we allow missing to avoid having to document the mij components. +#![allow(missing_doc)] // we allow missing to avoid having to document the mij components. use std::cast; use std::num::{One, Zero}; @@ -31,7 +31,7 @@ impl Identity { /// Square matrix of dimension 1. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Mat1 { - m11: N + pub m11: N } double_dispatch_binop_decl_trait!(Mat1, Mat1MulRhs) @@ -123,8 +123,8 @@ outer_impl!(Vec1, Mat1) /// Square matrix of dimension 2. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Mat2 { - m11: N, m21: N, - m12: N, m22: N + pub m11: N, pub m21: N, + pub m12: N, pub m22: N } double_dispatch_binop_decl_trait!(Mat2, Mat2MulRhs) @@ -220,9 +220,9 @@ outer_impl!(Vec2, Mat2) /// Square matrix of dimension 3. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Mat3 { - m11: N, m21: N, m31: N, - m12: N, m22: N, m32: N, - m13: N, m23: N, m33: N + pub m11: N, pub m21: N, pub m31: N, + pub m12: N, pub m22: N, pub m32: N, + pub m13: N, pub m23: N, pub m33: N } double_dispatch_binop_decl_trait!(Mat3, Mat3MulRhs) @@ -331,10 +331,10 @@ outer_impl!(Vec3, Mat3) /// Square matrix of dimension 4. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Mat4 { - m11: N, m21: N, m31: N, m41: N, - m12: N, m22: N, m32: N, m42: N, - m13: N, m23: N, m33: N, m43: N, - m14: N, m24: N, m34: N, m44: N + pub m11: N, pub m21: N, pub m31: N, pub m41: N, + pub m12: N, pub m22: N, pub m32: N, pub m42: N, + pub m13: N, pub m23: N, pub m33: N, pub m43: N, + pub m14: N, pub m24: N, pub m34: N, pub m44: N } double_dispatch_binop_decl_trait!(Mat4, Mat4MulRhs) @@ -494,11 +494,11 @@ outer_impl!(Vec4, Mat4) /// Square matrix of dimension 5. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Mat5 { - m11: N, m21: N, m31: N, m41: N, m51: N, - m12: N, m22: N, m32: N, m42: N, m52: N, - m13: N, m23: N, m33: N, m43: N, m53: N, - m14: N, m24: N, m34: N, m44: N, m54: N, - m15: N, m25: N, m35: N, m45: N, m55: N + 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, + pub m13: N, pub m23: N, pub m33: N, pub m43: N, pub m53: N, + pub m14: N, pub m24: N, pub m34: N, pub m44: N, pub m54: N, + pub m15: N, pub m25: N, pub m35: N, pub m45: N, pub m55: N } double_dispatch_binop_decl_trait!(Mat5, Mat5MulRhs) @@ -673,12 +673,12 @@ outer_impl!(Vec5, Mat5) /// Square matrix of dimension 6. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Mat6 { - m11: N, m21: N, m31: N, m41: N, m51: N, m61: N, - m12: N, m22: N, m32: N, m42: N, m52: N, m62: N, - m13: N, m23: N, m33: N, m43: N, m53: N, m63: N, - m14: N, m24: N, m34: N, m44: N, m54: N, m64: N, - m15: N, m25: N, m35: N, m45: N, m55: N, m65: N, - m16: N, m26: N, m36: N, m46: N, m56: N, m66: N + 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, + pub m13: N, pub m23: N, pub m33: N, pub m43: N, pub m53: N, pub m63: N, + pub m14: N, pub m24: N, pub m34: N, pub m44: N, pub m54: N, pub m64: N, + pub m15: N, pub m25: N, pub m35: N, pub m45: N, pub m55: N, pub m65: N, + pub m16: N, pub m26: N, pub m36: N, pub m46: N, pub m56: N, pub m66: N } double_dispatch_binop_decl_trait!(Mat6, Mat6MulRhs) diff --git a/src/structs/mat_macros.rs b/src/structs/mat_macros.rs index 712afe57..2c13926d 100644 --- a/src/structs/mat_macros.rs +++ b/src/structs/mat_macros.rs @@ -1,4 +1,4 @@ -#[macro_escape]; +#![macro_escape] macro_rules! mat_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( diff --git a/src/structs/metal.rs b/src/structs/metal.rs index 21c464b9..c91d19d2 100644 --- a/src/structs/metal.rs +++ b/src/structs/metal.rs @@ -1,6 +1,6 @@ -#[macro_escape]; +#![macro_escape] -#[doc(hidden)]; // we hide doc to not have to document the $trhs double dispatch trait. +#![doc(hidden)] // we hide doc to not have to document the $trhs double dispatch trait. // Create the traits needed to do fancy operator oveloading. // This is a meta version of diff --git a/src/structs/rot.rs b/src/structs/rot.rs index 2ec9e986..ace1501f 100644 --- a/src/structs/rot.rs +++ b/src/structs/rot.rs @@ -1,6 +1,6 @@ //! Rotations matrices. -#[allow(missing_doc)]; +#![allow(missing_doc)] use std::num::{Zero, One}; use rand::{Rand, Rng}; @@ -17,7 +17,7 @@ mod rot_macros; /// Two dimensional rotation matrix. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Show, Hash)] pub struct Rot2 { - priv submat: Mat2 + submat: Mat2 } impl> Rot2 { @@ -95,7 +95,7 @@ impl AbsoluteRotate> for Rot2 { /// Three dimensional rotation matrix. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Show, Hash)] pub struct Rot3 { - priv submat: Mat3 + submat: Mat3 } @@ -266,7 +266,7 @@ impl AbsoluteRotate> for Rot3 { /// Four dimensional rotation matrix. #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Show, Hash)] pub struct Rot4 { - priv submat: Mat4 + submat: Mat4 } // impl Rot4 { diff --git a/src/structs/rot_macros.rs b/src/structs/rot_macros.rs index 40808458..cee3972c 100644 --- a/src/structs/rot_macros.rs +++ b/src/structs/rot_macros.rs @@ -1,4 +1,4 @@ -#[macro_escape]; +#![macro_escape] macro_rules! submat_impl( ($t: ident, $submat: ident) => ( diff --git a/src/structs/spec/primitives.rs b/src/structs/spec/primitives.rs index cc7ccd61..76a5995c 100644 --- a/src/structs/spec/primitives.rs +++ b/src/structs/spec/primitives.rs @@ -1,7 +1,7 @@ //! nalgebra trait implementation for primitive types. -#[allow(missing_doc)]; -#[allow(non_camel_case_types)]; +#![allow(missing_doc)] +#![allow(non_camel_case_types)] use traits::structure::Cast; diff --git a/src/structs/spec/vec0.rs b/src/structs/spec/vec0.rs index d3dc1662..4843e3e1 100644 --- a/src/structs/spec/vec0.rs +++ b/src/structs/spec/vec0.rs @@ -207,7 +207,7 @@ impl One for vec::Vec0 { impl FromIterator for vec::Vec0 { #[inline] - fn from_iterator>(_: I) -> vec::Vec0 { + fn from_iter>(_: I) -> vec::Vec0 { vec::Vec0 } } diff --git a/src/structs/vec.rs b/src/structs/vec.rs index 2b3fa61c..ca72e130 100644 --- a/src/structs/vec.rs +++ b/src/structs/vec.rs @@ -1,6 +1,6 @@ //! Vectors with dimensions known at compile-time. -#[allow(missing_doc)]; // we allow missing to avoid having to document the vector components. +#![allow(missing_doc)] // we allow missing to avoid having to document the vector components. use std::cast; use std::num::{Zero, One, Float, Bounded}; @@ -23,7 +23,7 @@ pub struct Vec0; #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Vec1 { /// First component of the vector. - x: N + pub x: N } double_dispatch_binop_decl_trait!(Vec1, Vec1MulRhs) @@ -119,9 +119,9 @@ transform_impl!(Vec1) #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Vec2 { /// First component of the vector. - x: N, + pub x: N, /// Second component of the vector. - y: N + pub y: N } double_dispatch_binop_decl_trait!(Vec2, Vec2MulRhs) @@ -217,11 +217,11 @@ transform_impl!(Vec2) #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Vec3 { /// First component of the vector. - x: N, + pub x: N, /// Second component of the vector. - y: N, + pub y: N, /// Third component of the vector. - z: N + pub z: N } double_dispatch_binop_decl_trait!(Vec3, Vec3MulRhs) @@ -321,13 +321,13 @@ transform_impl!(Vec3) #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Vec4 { /// First component of the vector. - x: N, + pub x: N, /// Second component of the vector. - y: N, + pub y: N, /// Third component of the vector. - z: N, + pub z: N, /// Fourth component of the vector. - w: N + pub w: N } double_dispatch_binop_decl_trait!(Vec4, Vec4MulRhs) @@ -423,15 +423,15 @@ transform_impl!(Vec4) #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Vec5 { /// First component of the vector. - x: N, + pub x: N, /// Second component of the vector. - y: N, + pub y: N, /// Third component of the vector. - z: N, + pub z: N, /// Fourth component of the vector. - w: N, + pub w: N, /// Fifth of the vector. - a: N + pub a: N } double_dispatch_binop_decl_trait!(Vec5, Vec5MulRhs) @@ -527,17 +527,17 @@ transform_impl!(Vec5) #[deriving(TotalEq, Eq, Encodable, Decodable, Clone, Hash, Rand, Zero, Show)] pub struct Vec6 { /// First component of the vector. - x: N, + pub x: N, /// Second component of the vector. - y: N, + pub y: N, /// Third component of the vector. - z: N, + pub z: N, /// Fourth component of the vector. - w: N, + pub w: N, /// Fifth of the vector. - a: N, + pub a: N, /// Sixth component of the vector. - b: N + pub b: N } double_dispatch_binop_decl_trait!(Vec6, Vec6MulRhs) diff --git a/src/structs/vec_macros.rs b/src/structs/vec_macros.rs index fff0558d..584f5675 100644 --- a/src/structs/vec_macros.rs +++ b/src/structs/vec_macros.rs @@ -1,4 +1,4 @@ -#[macro_escape]; +#![macro_escape] macro_rules! new_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( @@ -560,7 +560,7 @@ macro_rules! from_iterator_impl( ($t: ident, $param0: ident $(, $paramN: ident)*) => ( impl FromIterator for $t { #[inline] - fn from_iterator>(mut $param0: I) -> $t { + fn from_iter>(mut $param0: I) -> $t { $t::new($param0.next().unwrap() $(, $paramN.next().unwrap())*) } }