Use #[cfg(not(stage0))] to exclude items from stage0

As requested on the mailing list: https://mail.mozilla.org/pipermail/rust-dev/2013-April/003713.html
This commit is contained in:
Brendan Zabarauskas 2013-04-24 22:26:14 +10:00
parent 03932f0b84
commit d4868ee740
10 changed files with 19 additions and 63 deletions

View file

@ -77,9 +77,7 @@ pub use kinds::{Const, Copy, Owned, Durable};
pub use ops::{Drop};
#[cfg(stage0)]
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[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};

View file

@ -278,10 +278,7 @@ impl Div<f32,f32> for f32 {
#[inline(always)]
fn div(&self, other: &f32) -> f32 { *self / *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Quot<f32,f32> for f32 {
#[inline(always)]
fn quot(&self, other: &f32) -> f32 { *self / *other }
@ -292,10 +289,7 @@ impl Modulo<f32,f32> for f32 {
#[inline(always)]
fn modulo(&self, other: &f32) -> f32 { *self % *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Rem<f32,f32> for f32 {
#[inline(always)]
fn rem(&self, other: &f32) -> f32 { *self % *other }

View file

@ -292,9 +292,7 @@ impl Mul<f64,f64> for f64 {
impl Div<f64,f64> for f64 {
fn div(&self, other: &f64) -> f64 { *self / *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Quot<f64,f64> for f64 {
#[inline(always)]
fn quot(&self, other: &f64) -> f64 { *self / *other }
@ -303,9 +301,7 @@ impl Quot<f64,f64> for f64 {
impl Modulo<f64,f64> for f64 {
fn modulo(&self, other: &f64) -> f64 { *self % *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Rem<f64,f64> for f64 {
#[inline(always)]
fn rem(&self, other: &f64) -> f64 { *self % *other }

View file

@ -459,9 +459,7 @@ impl Div<float,float> for float {
#[inline(always)]
fn div(&self, other: &float) -> float { *self / *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Quot<float,float> for float {
#[inline(always)]
fn quot(&self, other: &float) -> float { *self / *other }
@ -471,9 +469,7 @@ impl Modulo<float,float> for float {
#[inline(always)]
fn modulo(&self, other: &float) -> float { *self % *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Rem<float,float> for float {
#[inline(always)]
fn rem(&self, other: &float) -> float { *self % *other }

View file

@ -185,10 +185,7 @@ impl Div<T,T> for T {
#[inline(always)]
fn div(&self, other: &T) -> T { *self / *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Quot<T,T> for T {
/**
* Returns the integer quotient, truncated towards 0. As this behaviour reflects
@ -217,10 +214,7 @@ impl Modulo<T,T> for T {
#[inline(always)]
fn modulo(&self, other: &T) -> T { *self % *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Rem<T,T> for T {
/**
* Returns the integer remainder after division, satisfying:

View file

@ -16,9 +16,7 @@ use ops::{Add, Sub, Mul, Neg};
use Quot = ops::Div;
#[cfg(stage0)]
use Rem = ops::Modulo;
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[cfg(not(stage0))]
use ops::{Add, Sub, Mul, Quot, Rem, Neg};
use option::Option;
use kinds::Copy;

View file

@ -151,10 +151,7 @@ impl Div<T,T> for T {
#[inline(always)]
fn div(&self, other: &T) -> T { *self / *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Quot<T,T> for T {
#[inline(always)]
fn quot(&self, other: &T) -> T { *self / *other }
@ -165,10 +162,7 @@ impl Modulo<T,T> for T {
#[inline(always)]
fn modulo(&self, other: &T) -> T { *self % *other }
}
#[cfg(stage1,notest)]
#[cfg(stage2,notest)]
#[cfg(stage3,notest)]
#[cfg(not(stage0),notest)]
impl Rem<T,T> for T {
#[inline(always)]
fn rem(&self, other: &T) -> T { *self % *other }

View file

@ -36,9 +36,7 @@ pub trait Div<RHS,Result> {
fn div(&self, rhs: &RHS) -> Result;
}
#[lang="quot"]
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[cfg(not(stage0))]
pub trait Quot<RHS,Result> {
fn quot(&self, rhs: &RHS) -> Result;
}
@ -49,9 +47,7 @@ pub trait Modulo<RHS,Result> {
fn modulo(&self, rhs: &RHS) -> Result;
}
#[lang="rem"]
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[cfg(not(stage0))]
pub trait Rem<RHS,Result> {
fn rem(&self, rhs: &RHS) -> Result;
}

View file

@ -16,9 +16,7 @@ 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(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[cfg(not(stage0))]
pub use ops::{Add, Sub, Mul, Quot, Rem, Neg, Not};
pub use ops::{BitAnd, BitOr, BitXor};
pub use ops::{Drop};

View file

@ -76,9 +76,7 @@ pub mod rope;
pub mod smallintmap;
pub mod sort;
pub mod dlist;
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[cfg(not(stage0))]
pub mod treemap;
// And ... other stuff
@ -98,19 +96,13 @@ pub mod cmp;
pub mod base64;
pub mod rl;
pub mod workcache;
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[cfg(not(stage0))]
#[path="num/bigint.rs"]
pub mod bigint;
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[cfg(not(stage0))]
#[path="num/rational.rs"]
pub mod rational;
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[cfg(not(stage0))]
#[path="num/complex.rs"]
pub mod complex;
pub mod stats;