Skip to content

Commit d4868ee

Browse files
committed
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
1 parent 03932f0 commit d4868ee

File tree

10 files changed

+19
-63
lines changed

10 files changed

+19
-63
lines changed

src/libcore/core.rc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ pub use kinds::{Const, Copy, Owned, Durable};
7777
pub use ops::{Drop};
7878
#[cfg(stage0)]
7979
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
80-
#[cfg(stage1)]
81-
#[cfg(stage2)]
82-
#[cfg(stage3)]
80+
#[cfg(not(stage0))]
8381
pub use ops::{Add, Sub, Mul, Quot, Rem, Neg, Not};
8482
pub use ops::{BitAnd, BitOr, BitXor};
8583
pub use ops::{Shl, Shr, Index};

src/libcore/num/f32.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,7 @@ impl Div<f32,f32> for f32 {
278278
#[inline(always)]
279279
fn div(&self, other: &f32) -> f32 { *self / *other }
280280
}
281-
282-
#[cfg(stage1,notest)]
283-
#[cfg(stage2,notest)]
284-
#[cfg(stage3,notest)]
281+
#[cfg(not(stage0),notest)]
285282
impl Quot<f32,f32> for f32 {
286283
#[inline(always)]
287284
fn quot(&self, other: &f32) -> f32 { *self / *other }
@@ -292,10 +289,7 @@ impl Modulo<f32,f32> for f32 {
292289
#[inline(always)]
293290
fn modulo(&self, other: &f32) -> f32 { *self % *other }
294291
}
295-
296-
#[cfg(stage1,notest)]
297-
#[cfg(stage2,notest)]
298-
#[cfg(stage3,notest)]
292+
#[cfg(not(stage0),notest)]
299293
impl Rem<f32,f32> for f32 {
300294
#[inline(always)]
301295
fn rem(&self, other: &f32) -> f32 { *self % *other }

src/libcore/num/f64.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,7 @@ impl Mul<f64,f64> for f64 {
292292
impl Div<f64,f64> for f64 {
293293
fn div(&self, other: &f64) -> f64 { *self / *other }
294294
}
295-
#[cfg(stage1,notest)]
296-
#[cfg(stage2,notest)]
297-
#[cfg(stage3,notest)]
295+
#[cfg(not(stage0),notest)]
298296
impl Quot<f64,f64> for f64 {
299297
#[inline(always)]
300298
fn quot(&self, other: &f64) -> f64 { *self / *other }
@@ -303,9 +301,7 @@ impl Quot<f64,f64> for f64 {
303301
impl Modulo<f64,f64> for f64 {
304302
fn modulo(&self, other: &f64) -> f64 { *self % *other }
305303
}
306-
#[cfg(stage1,notest)]
307-
#[cfg(stage2,notest)]
308-
#[cfg(stage3,notest)]
304+
#[cfg(not(stage0),notest)]
309305
impl Rem<f64,f64> for f64 {
310306
#[inline(always)]
311307
fn rem(&self, other: &f64) -> f64 { *self % *other }

src/libcore/num/float.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,7 @@ impl Div<float,float> for float {
459459
#[inline(always)]
460460
fn div(&self, other: &float) -> float { *self / *other }
461461
}
462-
#[cfg(stage1,notest)]
463-
#[cfg(stage2,notest)]
464-
#[cfg(stage3,notest)]
462+
#[cfg(not(stage0),notest)]
465463
impl Quot<float,float> for float {
466464
#[inline(always)]
467465
fn quot(&self, other: &float) -> float { *self / *other }
@@ -471,9 +469,7 @@ impl Modulo<float,float> for float {
471469
#[inline(always)]
472470
fn modulo(&self, other: &float) -> float { *self % *other }
473471
}
474-
#[cfg(stage1,notest)]
475-
#[cfg(stage2,notest)]
476-
#[cfg(stage3,notest)]
472+
#[cfg(not(stage0),notest)]
477473
impl Rem<float,float> for float {
478474
#[inline(always)]
479475
fn rem(&self, other: &float) -> float { *self % *other }

src/libcore/num/int-template.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@ impl Div<T,T> for T {
185185
#[inline(always)]
186186
fn div(&self, other: &T) -> T { *self / *other }
187187
}
188-
189-
#[cfg(stage1,notest)]
190-
#[cfg(stage2,notest)]
191-
#[cfg(stage3,notest)]
188+
#[cfg(not(stage0),notest)]
192189
impl Quot<T,T> for T {
193190
/**
194191
* Returns the integer quotient, truncated towards 0. As this behaviour reflects
@@ -217,10 +214,7 @@ impl Modulo<T,T> for T {
217214
#[inline(always)]
218215
fn modulo(&self, other: &T) -> T { *self % *other }
219216
}
220-
221-
#[cfg(stage1,notest)]
222-
#[cfg(stage2,notest)]
223-
#[cfg(stage3,notest)]
217+
#[cfg(not(stage0),notest)]
224218
impl Rem<T,T> for T {
225219
/**
226220
* Returns the integer remainder after division, satisfying:

src/libcore/num/num.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ use ops::{Add, Sub, Mul, Neg};
1616
use Quot = ops::Div;
1717
#[cfg(stage0)]
1818
use Rem = ops::Modulo;
19-
#[cfg(stage1)]
20-
#[cfg(stage2)]
21-
#[cfg(stage3)]
19+
#[cfg(not(stage0))]
2220
use ops::{Add, Sub, Mul, Quot, Rem, Neg};
2321
use option::Option;
2422
use kinds::Copy;

src/libcore/num/uint-template.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,7 @@ impl Div<T,T> for T {
151151
#[inline(always)]
152152
fn div(&self, other: &T) -> T { *self / *other }
153153
}
154-
155-
#[cfg(stage1,notest)]
156-
#[cfg(stage2,notest)]
157-
#[cfg(stage3,notest)]
154+
#[cfg(not(stage0),notest)]
158155
impl Quot<T,T> for T {
159156
#[inline(always)]
160157
fn quot(&self, other: &T) -> T { *self / *other }
@@ -165,10 +162,7 @@ impl Modulo<T,T> for T {
165162
#[inline(always)]
166163
fn modulo(&self, other: &T) -> T { *self % *other }
167164
}
168-
169-
#[cfg(stage1,notest)]
170-
#[cfg(stage2,notest)]
171-
#[cfg(stage3,notest)]
165+
#[cfg(not(stage0),notest)]
172166
impl Rem<T,T> for T {
173167
#[inline(always)]
174168
fn rem(&self, other: &T) -> T { *self % *other }

src/libcore/ops.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ pub trait Div<RHS,Result> {
3636
fn div(&self, rhs: &RHS) -> Result;
3737
}
3838
#[lang="quot"]
39-
#[cfg(stage1)]
40-
#[cfg(stage2)]
41-
#[cfg(stage3)]
39+
#[cfg(not(stage0))]
4240
pub trait Quot<RHS,Result> {
4341
fn quot(&self, rhs: &RHS) -> Result;
4442
}
@@ -49,9 +47,7 @@ pub trait Modulo<RHS,Result> {
4947
fn modulo(&self, rhs: &RHS) -> Result;
5048
}
5149
#[lang="rem"]
52-
#[cfg(stage1)]
53-
#[cfg(stage2)]
54-
#[cfg(stage3)]
50+
#[cfg(not(stage0))]
5551
pub trait Rem<RHS,Result> {
5652
fn rem(&self, rhs: &RHS) -> Result;
5753
}

src/libcore/prelude.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ pub use either::{Either, Left, Right};
1616
pub use kinds::{Const, Copy, Owned, Durable};
1717
#[cfg(stage0)]
1818
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
19-
#[cfg(stage1)]
20-
#[cfg(stage2)]
21-
#[cfg(stage3)]
19+
#[cfg(not(stage0))]
2220
pub use ops::{Add, Sub, Mul, Quot, Rem, Neg, Not};
2321
pub use ops::{BitAnd, BitOr, BitXor};
2422
pub use ops::{Drop};

src/libstd/std.rc

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ pub mod rope;
7676
pub mod smallintmap;
7777
pub mod sort;
7878
pub mod dlist;
79-
#[cfg(stage1)]
80-
#[cfg(stage2)]
81-
#[cfg(stage3)]
79+
#[cfg(not(stage0))]
8280
pub mod treemap;
8381

8482
// And ... other stuff
@@ -98,19 +96,13 @@ pub mod cmp;
9896
pub mod base64;
9997
pub mod rl;
10098
pub mod workcache;
101-
#[cfg(stage1)]
102-
#[cfg(stage2)]
103-
#[cfg(stage3)]
99+
#[cfg(not(stage0))]
104100
#[path="num/bigint.rs"]
105101
pub mod bigint;
106-
#[cfg(stage1)]
107-
#[cfg(stage2)]
108-
#[cfg(stage3)]
102+
#[cfg(not(stage0))]
109103
#[path="num/rational.rs"]
110104
pub mod rational;
111-
#[cfg(stage1)]
112-
#[cfg(stage2)]
113-
#[cfg(stage3)]
105+
#[cfg(not(stage0))]
114106
#[path="num/complex.rs"]
115107
pub mod complex;
116108
pub mod stats;

0 commit comments

Comments
 (0)