desnapshot
This commit is contained in:
parent
202b8dcdc4
commit
b5a7e8b353
@ -75,9 +75,6 @@ they contained the following prologue:
|
||||
|
||||
pub use kinds::{Const, Copy, Owned, Durable};
|
||||
pub use ops::{Drop};
|
||||
#[cfg(stage0)]
|
||||
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
|
||||
#[cfg(not(stage0))]
|
||||
pub use ops::{Add, Sub, Mul, Quot, Rem, Neg, Not};
|
||||
pub use ops::{BitAnd, BitOr, BitXor};
|
||||
pub use ops::{Shl, Shr, Index};
|
||||
|
@ -278,24 +278,12 @@ impl Mul<f32,f32> for f32 {
|
||||
#[inline(always)]
|
||||
fn mul(&self, other: &f32) -> f32 { *self * *other }
|
||||
}
|
||||
|
||||
#[cfg(stage0,notest)]
|
||||
impl Div<f32,f32> for f32 {
|
||||
#[inline(always)]
|
||||
fn div(&self, other: &f32) -> f32 { *self / *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
#[cfg(notest)]
|
||||
impl Quot<f32,f32> for f32 {
|
||||
#[inline(always)]
|
||||
fn quot(&self, other: &f32) -> f32 { *self / *other }
|
||||
}
|
||||
|
||||
#[cfg(stage0,notest)]
|
||||
impl Modulo<f32,f32> for f32 {
|
||||
#[inline(always)]
|
||||
fn modulo(&self, other: &f32) -> f32 { *self % *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
#[cfg(notest)]
|
||||
impl Rem<f32,f32> for f32 {
|
||||
#[inline(always)]
|
||||
fn rem(&self, other: &f32) -> f32 { *self % *other }
|
||||
|
@ -296,20 +296,12 @@ impl Sub<f64,f64> for f64 {
|
||||
impl Mul<f64,f64> for f64 {
|
||||
fn mul(&self, other: &f64) -> f64 { *self * *other }
|
||||
}
|
||||
#[cfg(stage0,notest)]
|
||||
impl Div<f64,f64> for f64 {
|
||||
fn div(&self, other: &f64) -> f64 { *self / *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
#[cfg(notest)]
|
||||
impl Quot<f64,f64> for f64 {
|
||||
#[inline(always)]
|
||||
fn quot(&self, other: &f64) -> f64 { *self / *other }
|
||||
}
|
||||
#[cfg(stage0,notest)]
|
||||
impl Modulo<f64,f64> for f64 {
|
||||
fn modulo(&self, other: &f64) -> f64 { *self % *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
#[cfg(notest)]
|
||||
impl Rem<f64,f64> for f64 {
|
||||
#[inline(always)]
|
||||
fn rem(&self, other: &f64) -> f64 { *self % *other }
|
||||
|
@ -691,23 +691,12 @@ impl Mul<float,float> for float {
|
||||
#[inline(always)]
|
||||
fn mul(&self, other: &float) -> float { *self * *other }
|
||||
}
|
||||
|
||||
#[cfg(stage0,notest)]
|
||||
impl Div<float,float> for float {
|
||||
#[inline(always)]
|
||||
fn div(&self, other: &float) -> float { *self / *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
#[cfg(notest)]
|
||||
impl Quot<float,float> for float {
|
||||
#[inline(always)]
|
||||
fn quot(&self, other: &float) -> float { *self / *other }
|
||||
}
|
||||
#[cfg(stage0,notest)]
|
||||
impl Modulo<float,float> for float {
|
||||
#[inline(always)]
|
||||
fn modulo(&self, other: &float) -> float { *self % *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
#[cfg(notest)]
|
||||
impl Rem<float,float> for float {
|
||||
#[inline(always)]
|
||||
fn rem(&self, other: &float) -> float { *self % *other }
|
||||
|
@ -200,13 +200,6 @@ impl Mul<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn mul(&self, other: &T) -> T { *self * *other }
|
||||
}
|
||||
|
||||
#[cfg(stage0,notest)]
|
||||
impl Div<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn div(&self, other: &T) -> T { *self / *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
impl Quot<T,T> for T {
|
||||
///
|
||||
/// Returns the integer quotient, truncated towards 0. As this behaviour reflects
|
||||
@ -229,13 +222,6 @@ impl Quot<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn quot(&self, other: &T) -> T { *self / *other }
|
||||
}
|
||||
|
||||
#[cfg(stage0,notest)]
|
||||
impl Modulo<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn modulo(&self, other: &T) -> T { *self % *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
impl Rem<T,T> for T {
|
||||
///
|
||||
/// Returns the integer remainder after division, satisfying:
|
||||
|
@ -10,13 +10,6 @@
|
||||
|
||||
//! An interface for numeric types
|
||||
use cmp::{Eq, Ord};
|
||||
#[cfg(stage0)]
|
||||
use ops::{Add, Sub, Mul, Neg};
|
||||
#[cfg(stage0)]
|
||||
use Quot = ops::Div;
|
||||
#[cfg(stage0)]
|
||||
use Rem = ops::Modulo;
|
||||
#[cfg(not(stage0))]
|
||||
use ops::{Add, Sub, Mul, Quot, Rem, Neg};
|
||||
use ops::{Not, BitAnd, BitOr, BitXor, Shl, Shr};
|
||||
use option::Option;
|
||||
@ -391,25 +384,8 @@ pub fn pow_with_uint<T:NumCast+One+Zero+Copy+Quot<T,T>+Mul<T,T>>(
|
||||
total
|
||||
}
|
||||
|
||||
/// Helper function for testing numeric operations
|
||||
#[cfg(stage0,test)]
|
||||
pub fn test_num<T:Num + NumCast>(ten: T, two: T) {
|
||||
assert_eq!(ten.add(&two), cast(12));
|
||||
assert_eq!(ten.sub(&two), cast(8));
|
||||
assert_eq!(ten.mul(&two), cast(20));
|
||||
assert_eq!(ten.div(&two), cast(5));
|
||||
assert_eq!(ten.modulo(&two), cast(0));
|
||||
|
||||
assert_eq!(ten.add(&two), ten + two);
|
||||
assert_eq!(ten.sub(&two), ten - two);
|
||||
assert_eq!(ten.mul(&two), ten * two);
|
||||
assert_eq!(ten.div(&two), ten / two);
|
||||
assert_eq!(ten.modulo(&two), ten % two);
|
||||
}
|
||||
#[cfg(stage1,test)]
|
||||
#[cfg(stage2,test)]
|
||||
#[cfg(stage3,test)]
|
||||
pub fn test_num<T:Num + NumCast>(ten: T, two: T) {
|
||||
#[cfg(test)]
|
||||
fn test_num<T:Num + NumCast>(ten: T, two: T) {
|
||||
assert_eq!(ten.add(&two), cast(12));
|
||||
assert_eq!(ten.sub(&two), cast(8));
|
||||
assert_eq!(ten.mul(&two), cast(20));
|
||||
|
@ -9,15 +9,6 @@
|
||||
// except according to those terms.
|
||||
|
||||
use core::cmp::{Ord, Eq};
|
||||
#[cfg(stage0)]
|
||||
use ops::{Add, Sub, Mul, Neg};
|
||||
#[cfg(stage0)]
|
||||
use Quot = ops::Div;
|
||||
#[cfg(stage0)]
|
||||
use Rem = ops::Modulo;
|
||||
#[cfg(stage1)]
|
||||
#[cfg(stage2)]
|
||||
#[cfg(stage3)]
|
||||
use ops::{Add, Sub, Mul, Quot, Rem, Neg};
|
||||
use option::{None, Option, Some};
|
||||
use char;
|
||||
|
@ -165,24 +165,10 @@ impl Mul<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn mul(&self, other: &T) -> T { *self * *other }
|
||||
}
|
||||
|
||||
#[cfg(stage0,notest)]
|
||||
impl Div<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn div(&self, other: &T) -> T { *self / *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
impl Quot<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn quot(&self, other: &T) -> T { *self / *other }
|
||||
}
|
||||
|
||||
#[cfg(stage0,notest)]
|
||||
impl Modulo<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn modulo(&self, other: &T) -> T { *self % *other }
|
||||
}
|
||||
#[cfg(not(stage0),notest)]
|
||||
impl Rem<T,T> for T {
|
||||
#[inline(always)]
|
||||
fn rem(&self, other: &T) -> T { *self % *other }
|
||||
|
@ -30,24 +30,12 @@ pub trait Mul<RHS,Result> {
|
||||
fn mul(&self, rhs: &RHS) -> Result;
|
||||
}
|
||||
|
||||
#[lang="div"]
|
||||
#[cfg(stage0)]
|
||||
pub trait Div<RHS,Result> {
|
||||
fn div(&self, rhs: &RHS) -> Result;
|
||||
}
|
||||
#[lang="quot"]
|
||||
#[cfg(not(stage0))]
|
||||
pub trait Quot<RHS,Result> {
|
||||
fn quot(&self, rhs: &RHS) -> Result;
|
||||
}
|
||||
|
||||
#[lang="modulo"]
|
||||
#[cfg(stage0)]
|
||||
pub trait Modulo<RHS,Result> {
|
||||
fn modulo(&self, rhs: &RHS) -> Result;
|
||||
}
|
||||
#[lang="rem"]
|
||||
#[cfg(not(stage0))]
|
||||
pub trait Rem<RHS,Result> {
|
||||
fn rem(&self, rhs: &RHS) -> Result;
|
||||
}
|
||||
|
@ -14,9 +14,6 @@
|
||||
|
||||
pub use either::{Either, Left, Right};
|
||||
pub use kinds::{Const, Copy, Owned, Durable};
|
||||
#[cfg(stage0)]
|
||||
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
|
||||
#[cfg(not(stage0))]
|
||||
pub use ops::{Add, Sub, Mul, Quot, Rem, Neg, Not};
|
||||
pub use ops::{BitAnd, BitOr, BitXor};
|
||||
pub use ops::{Drop};
|
||||
|
@ -23,7 +23,6 @@ use io::{Writer, WriterUtil};
|
||||
use libc::c_void;
|
||||
use managed;
|
||||
use ptr;
|
||||
#[cfg(stage0)] use sys;
|
||||
use reflect;
|
||||
use reflect::{MovePtr, align};
|
||||
use to_str::ToStr;
|
||||
|
@ -125,18 +125,15 @@ pub mod file;
|
||||
pub mod net;
|
||||
|
||||
/// Readers and Writers for memory buffers and strings.
|
||||
#[cfg(not(stage0))] // XXX Using unsnapshotted features
|
||||
pub mod mem;
|
||||
|
||||
/// Non-blocking access to stdin, stdout, stderr
|
||||
pub mod stdio;
|
||||
|
||||
/// Basic stream compression. XXX: Belongs with other flate code
|
||||
#[cfg(not(stage0))] // XXX Using unsnapshotted features
|
||||
pub mod flate;
|
||||
|
||||
/// Interop between byte streams and pipes. Not sure where it belongs
|
||||
#[cfg(not(stage0))] // XXX "
|
||||
pub mod comm_adapters;
|
||||
|
||||
/// Extension traits
|
||||
|
@ -91,13 +91,10 @@ pub mod cmp;
|
||||
pub mod base64;
|
||||
pub mod rl;
|
||||
pub mod workcache;
|
||||
#[cfg(not(stage0))]
|
||||
#[path="num/bigint.rs"]
|
||||
pub mod bigint;
|
||||
#[cfg(not(stage0))]
|
||||
#[path="num/rational.rs"]
|
||||
pub mod rational;
|
||||
#[cfg(not(stage0))]
|
||||
#[path="num/complex.rs"]
|
||||
pub mod complex;
|
||||
pub mod stats;
|
||||
|
Loading…
x
Reference in New Issue
Block a user