From e63ce6f9e29d285f0e825836b8fdf989bc1a8a20 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 6 Apr 2015 13:22:32 -0400 Subject: [PATCH 1/4] Switched Travis to rust-1.0 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6a7159d..98bbf43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ # limitations under the License. language: rust +rust: +- 1.0.0-beta env: global: - secure: S0l5RmsFJgbDdzXjHsCluexb1R9RklpxZMJgr9RcieeqSqaJDPUht53yBZDyuk04/KzEbtM5yxogJd2tcv2E4EogPLL8oG77GItNc/i6jy4TLUjU28WKOMiBvYA/1rhb7f/DEQgj7DtIHP/rQGKH8goUdJfqGbk7EawP7FSxC2Y= From a058142a2cd46d0ac704f1f6302b3431b4f9410d Mon Sep 17 00:00:00 2001 From: Ryan Stewart Date: Mon, 6 Apr 2015 11:06:54 -0700 Subject: [PATCH 2/4] Get cgmath building in beta by removing remaining unstable feature use. Benching is unstable and therefore only available on nightly; removed from travis in the interim. --- .travis.yml | 1 - src/angle.rs | 3 ++- src/lib.rs | 1 - src/rotation.rs | 1 - src/transform.rs | 6 +++++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 98bbf43..ef83cf5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,6 @@ env: script: - cargo build - cargo test - - cargo bench - cargo doc after_script: # the doc directory needs to be in the root for rust-ci diff --git a/src/angle.rs b/src/angle.rs index 70f30c8..e3a84b8 100644 --- a/src/angle.rs +++ b/src/angle.rs @@ -276,10 +276,11 @@ impl One for Deg { fn one() -> Deg { deg(one()) } } +const PI_2: f64 = f64::consts::PI * 2f64; impl Angle for Rad { #[inline] fn from>(theta: A) -> Rad { theta.to_rad() } - #[inline] fn full_turn() -> Rad { rad(cast(f64::consts::PI_2).unwrap()) } + #[inline] fn full_turn() -> Rad { rad(cast(PI_2).unwrap()) } } impl diff --git a/src/lib.rs b/src/lib.rs index 4d2fcbd..261d681 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,6 @@ #![crate_type = "rlib"] #![crate_type = "dylib"] -#![feature(plugin, core, custom_derive)] //! Computer graphics-centric math. //! diff --git a/src/rotation.rs b/src/rotation.rs index d2335dc..cf3e689 100644 --- a/src/rotation.rs +++ b/src/rotation.rs @@ -133,7 +133,6 @@ pub trait Rotation3: Rotation, Point3> /// matrix: /// /// ```no_run -/// #![feature(core)] /// use cgmath::rad; /// use cgmath::Vector2; /// use cgmath::{Matrix, ToMatrix2}; diff --git a/src/transform.rs b/src/transform.rs index fc41c1e..aca4006 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -14,6 +14,7 @@ // limitations under the License. use std::fmt; +use std::marker::PhantomFn; use rust_num::{zero, one}; @@ -237,7 +238,10 @@ impl Transform3 for AffineMatrix3 {} /// A trait that allows extracting components (rotation, translation, scale) /// from an arbitrary transformations -pub trait ToComponents, P: Point, R: Rotation> { +// PhantomFn works around a beta bug in deteriming the usage of S/P, and should be safely removed +// when PhantomFn deprecation lands in stable. +pub trait ToComponents, P: Point, R: Rotation> + : PhantomFn + PhantomFn

{ /// Extract the (scale, rotation, translation) triple fn decompose(&self) -> (V, R, V); } From 8a34332f5f49306e7a85a84723d2389d7cb3b7ff Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 24 Apr 2015 13:54:03 +0200 Subject: [PATCH 3/4] Rustup --- .travis.yml | 2 +- src/transform.rs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef83cf5..1fb3cfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ language: rust rust: -- 1.0.0-beta +- 1.0.0-beta.2 env: global: - secure: S0l5RmsFJgbDdzXjHsCluexb1R9RklpxZMJgr9RcieeqSqaJDPUht53yBZDyuk04/KzEbtM5yxogJd2tcv2E4EogPLL8oG77GItNc/i6jy4TLUjU28WKOMiBvYA/1rhb7f/DEQgj7DtIHP/rQGKH8goUdJfqGbk7EawP7FSxC2Y= diff --git a/src/transform.rs b/src/transform.rs index aca4006..9e09f12 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -14,7 +14,6 @@ // limitations under the License. use std::fmt; -use std::marker::PhantomFn; use rust_num::{zero, one}; @@ -238,10 +237,7 @@ impl Transform3 for AffineMatrix3 {} /// A trait that allows extracting components (rotation, translation, scale) /// from an arbitrary transformations -// PhantomFn works around a beta bug in deteriming the usage of S/P, and should be safely removed -// when PhantomFn deprecation lands in stable. -pub trait ToComponents, P: Point, R: Rotation> - : PhantomFn + PhantomFn

{ +pub trait ToComponents, P: Point, R: Rotation> { /// Extract the (scale, rotation, translation) triple fn decompose(&self) -> (V, R, V); } From 508a45405b17daa5de18fb029ce525970b1c42ee Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 6 May 2015 16:15:44 +0200 Subject: [PATCH 4/4] Test for both the beta and the nightly --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1fb3cfe..dec23a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,11 @@ # limitations under the License. language: rust + rust: -- 1.0.0-beta.2 + - 1.0.0-beta.4 + - nightly + env: global: - secure: S0l5RmsFJgbDdzXjHsCluexb1R9RklpxZMJgr9RcieeqSqaJDPUht53yBZDyuk04/KzEbtM5yxogJd2tcv2E4EogPLL8oG77GItNc/i6jy4TLUjU28WKOMiBvYA/1rhb7f/DEQgj7DtIHP/rQGKH8goUdJfqGbk7EawP7FSxC2Y=