Update to the last rust-nightly.

Version of rustc: 0.13.0-nightly (336349c93 2014-11-17 20:37:19 +0000).
This commit is contained in:
Sébastien Crozet 2014-11-19 12:11:32 +01:00
parent 77348f668f
commit d8dfedbf99
7 changed files with 28 additions and 32 deletions

View File

@ -109,7 +109,6 @@ extern crate serialize;
extern crate test; extern crate test;
use std::cmp; use std::cmp;
pub use traits::{PartialLess, PartialEqual, PartialGreater, NotComparable};
pub use traits::{ pub use traits::{
Absolute, Absolute,
AbsoluteRotate, AbsoluteRotate,

View File

@ -5,8 +5,7 @@
use std::mem; use std::mem;
use std::slice::{Items, MutItems}; use std::slice::{Items, MutItems};
use std::iter::{Iterator, FromIterator}; use std::iter::{Iterator, FromIterator};
use traits::operations::{ApproxEq, POrd, POrdering, PartialLess, PartialEqual, use traits::operations::{ApproxEq, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
PartialGreater, NotComparable, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv}; ScalarDiv};
use traits::structure::{Cast, Dim, Indexable, Iterable, IterableMut, PntAsVec, Shape, use traits::structure::{Cast, Dim, Indexable, Iterable, IterableMut, PntAsVec, Shape,
NumPnt, FloatPnt, BaseFloat, BaseNum, Zero, One, Bounded}; NumPnt, FloatPnt, BaseFloat, BaseNum, Zero, One, Bounded};

View File

@ -7,8 +7,7 @@ use std::num;
use std::rand::{Rand, Rng}; use std::rand::{Rand, Rng};
use std::slice::{Items, MutItems}; use std::slice::{Items, MutItems};
use structs::{Vec3, Pnt3, Rot3, Mat3, Vec3MulRhs, Pnt3MulRhs}; use structs::{Vec3, Pnt3, Rot3, Mat3, Vec3MulRhs, Pnt3MulRhs};
use traits::operations::{ApproxEq, Inv, POrd, POrdering, NotComparable, PartialLess, use traits::operations::{ApproxEq, Inv, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
PartialGreater, PartialEqual, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv}; ScalarDiv};
use traits::structure::{Cast, Indexable, Iterable, IterableMut, Dim, Shape, BaseFloat, BaseNum, Zero, use traits::structure::{Cast, Indexable, Iterable, IterableMut, Dim, Shape, BaseFloat, BaseNum, Zero,
One, Bounded}; One, Bounded};

View File

@ -5,8 +5,7 @@
use std::mem; use std::mem;
use std::slice::{Items, MutItems}; use std::slice::{Items, MutItems};
use std::iter::{Iterator, FromIterator}; use std::iter::{Iterator, FromIterator};
use traits::operations::{ApproxEq, POrd, POrdering, PartialLess, PartialEqual, use traits::operations::{ApproxEq, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
PartialGreater, NotComparable, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv, Absolute}; ScalarDiv, Absolute};
use traits::geometry::{Transform, Rotate, FromHomogeneous, ToHomogeneous, Dot, Norm, use traits::geometry::{Transform, Rotate, FromHomogeneous, ToHomogeneous, Dot, Norm,
Translation, Translate}; Translation, Translate};

View File

@ -80,16 +80,16 @@ macro_rules! ord_impl(
if is_lt { // < if is_lt { // <
$( $(
if a.$compN > b.$compN { if a.$compN > b.$compN {
return NotComparable return POrdering::NotComparable
} }
)* )*
PartialLess POrdering::PartialLess
} }
else { // >= else { // >=
$( $(
if a.$compN < b.$compN { if a.$compN < b.$compN {
return NotComparable return POrdering::NotComparable
} }
else if a.$compN > b.$compN { else if a.$compN > b.$compN {
is_eq = false; is_eq = false;
@ -98,10 +98,10 @@ macro_rules! ord_impl(
)* )*
if is_eq { if is_eq {
PartialEqual POrdering::PartialEqual
} }
else { else {
PartialGreater POrdering::PartialGreater
} }
} }
} }

View File

@ -11,7 +11,7 @@ pub use traits::structure::{FloatVec, FloatPnt, Basis, Cast, Col, Dim, Indexable
pub use traits::operations::{Absolute, ApproxEq, Axpy, Cov, Det, Inv, LMul, Mean, Outer, POrd, pub use traits::operations::{Absolute, ApproxEq, Axpy, Cov, Det, Inv, LMul, Mean, Outer, POrd,
RMul, ScalarAdd, ScalarSub, ScalarMul, ScalarDiv, Transpose, EigenQR}; RMul, ScalarAdd, ScalarSub, ScalarMul, ScalarDiv, Transpose, EigenQR};
pub use traits::operations::{POrdering, PartialLess, PartialEqual, PartialGreater, NotComparable}; pub use traits::operations::POrdering;
pub mod geometry; pub mod geometry;
pub mod structure; pub mod structure;

View File

@ -19,40 +19,40 @@ pub enum POrdering {
impl POrdering { impl POrdering {
/// Returns `true` if `self` is equal to `Equal`. /// Returns `true` if `self` is equal to `Equal`.
pub fn is_eq(&self) -> bool { pub fn is_eq(&self) -> bool {
*self == PartialEqual *self == POrdering::PartialEqual
} }
/// Returns `true` if `self` is equal to `Less`. /// Returns `true` if `self` is equal to `Less`.
pub fn is_lt(&self) -> bool { pub fn is_lt(&self) -> bool {
*self == PartialLess *self == POrdering::PartialLess
} }
/// Returns `true` if `self` is equal to `Less` or `Equal`. /// Returns `true` if `self` is equal to `Less` or `Equal`.
pub fn is_le(&self) -> bool { pub fn is_le(&self) -> bool {
*self == PartialLess || *self == PartialEqual *self == POrdering::PartialLess || *self == POrdering::PartialEqual
} }
/// Returns `true` if `self` is equal to `Greater`. /// Returns `true` if `self` is equal to `Greater`.
pub fn is_gt(&self) -> bool { pub fn is_gt(&self) -> bool {
*self == PartialGreater *self == POrdering::PartialGreater
} }
/// Returns `true` if `self` is equal to `Greater` or `Equal`. /// Returns `true` if `self` is equal to `Greater` or `Equal`.
pub fn is_ge(&self) -> bool { pub fn is_ge(&self) -> bool {
*self == PartialGreater || *self == PartialEqual *self == POrdering::PartialGreater || *self == POrdering::PartialEqual
} }
/// Returns `true` if `self` is equal to `NotComparable`. /// Returns `true` if `self` is equal to `NotComparable`.
pub fn is_not_comparable(&self) -> bool { pub fn is_not_comparable(&self) -> bool {
*self == NotComparable *self == POrdering::NotComparable
} }
/// Creates a `POrdering` from an `Ordering`. /// Creates a `POrdering` from an `Ordering`.
pub fn from_ordering(ord: Ordering) -> POrdering { pub fn from_ordering(ord: Ordering) -> POrdering {
match ord { match ord {
Less => PartialLess, Less => POrdering::PartialLess,
Equal => PartialEqual, Equal => POrdering::PartialEqual,
Greater => PartialGreater Greater => POrdering::PartialGreater
} }
} }
@ -61,10 +61,10 @@ impl POrdering {
/// Returns `None` if `self` is `NotComparable`. /// Returns `None` if `self` is `NotComparable`.
pub fn to_ordering(self) -> Option<Ordering> { pub fn to_ordering(self) -> Option<Ordering> {
match self { match self {
PartialLess => Some(Less), POrdering::PartialLess => Some(Less),
PartialEqual => Some(Equal), POrdering::PartialEqual => Some(Equal),
PartialGreater => Some(Greater), POrdering::PartialGreater => Some(Greater),
NotComparable => None POrdering::NotComparable => None
} }
} }
} }
@ -108,9 +108,9 @@ pub trait POrd {
#[inline] #[inline]
fn partial_min<'a>(a: &'a Self, b: &'a Self) -> Option<&'a Self> { fn partial_min<'a>(a: &'a Self, b: &'a Self) -> Option<&'a Self> {
match POrd::partial_cmp(a, b) { match POrd::partial_cmp(a, b) {
PartialLess | PartialEqual => Some(a), POrdering::PartialLess | POrdering::PartialEqual => Some(a),
PartialGreater => Some(b), POrdering::PartialGreater => Some(b),
NotComparable => None POrdering::NotComparable => None
} }
} }
@ -118,9 +118,9 @@ pub trait POrd {
#[inline] #[inline]
fn partial_max<'a>(a: &'a Self, b: &'a Self) -> Option<&'a Self> { fn partial_max<'a>(a: &'a Self, b: &'a Self) -> Option<&'a Self> {
match POrd::partial_cmp(a, b) { match POrd::partial_cmp(a, b) {
PartialGreater | PartialEqual => Some(a), POrdering::PartialGreater | POrdering::PartialEqual => Some(a),
PartialLess => Some(b), POrdering::PartialLess => Some(b),
NotComparable => None POrdering::NotComparable => None
} }
} }