diff --git a/src/libcore/cast.rs b/src/libcore/cast.rs index 6fb737d37709f..ad32d9c838cd8 100644 --- a/src/libcore/cast.rs +++ b/src/libcore/cast.rs @@ -22,9 +22,7 @@ pub mod rusti { #[cfg(stage0)] fn reinterpret_cast(&&e: T) -> U; - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn transmute(e: T) -> U; } } @@ -45,9 +43,7 @@ pub unsafe fn transmute_copy(src: &T) -> U { } #[inline(always)] -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub unsafe fn transmute_copy(src: &T) -> U { let mut dest: U = unstable::intrinsics::init(); { @@ -96,9 +92,7 @@ pub unsafe fn transmute(thing: L) -> G { } #[inline(always)] -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub unsafe fn transmute(thing: L) -> G { rusti::transmute(thing) } @@ -165,9 +159,7 @@ mod tests { } #[test] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn test_transmute_copy() { assert!(1u == unsafe { ::cast::transmute_copy(&1) }); } diff --git a/src/libcore/container.rs b/src/libcore/container.rs index 88c78aebfc5c7..fef048a7acf00 100644 --- a/src/libcore/container.rs +++ b/src/libcore/container.rs @@ -58,9 +58,7 @@ pub trait Map: Mutable { fn remove(&mut self, key: &K) -> bool; } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub trait Map: Mutable { /// Return true if the map contains a value for the specified key fn contains_key(&self, key: &K) -> bool; diff --git a/src/libcore/hashmap.rs b/src/libcore/hashmap.rs index 41f4f34dc1971..c5b40b0cd9541 100644 --- a/src/libcore/hashmap.rs +++ b/src/libcore/hashmap.rs @@ -193,9 +193,7 @@ priv impl HashMap { } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn value_for_bucket<'a>(&'a self, idx: uint) -> &'a V { match self.buckets[idx] { @@ -213,9 +211,7 @@ priv impl HashMap { } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn mut_value_for_bucket<'a>(&'a mut self, idx: uint) -> &'a mut V { match self.buckets[idx] { @@ -341,9 +337,7 @@ impl Map for HashMap { } /// Visit all key-value pairs - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each<'a>(&'a self, blk: &fn(&'a K, &'a V) -> bool) { for uint::range(0, self.buckets.len()) |i| { for self.buckets[i].each |bucket| { @@ -366,9 +360,7 @@ impl Map for HashMap { } /// Visit all values - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each_value<'a>(&'a self, blk: &fn(v: &'a V) -> bool) { self.each(|_, v| blk(v)) } @@ -395,9 +387,7 @@ impl Map for HashMap { } /// Return a reference to the value corresponding to the key - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn find<'a>(&'a self, k: &K) -> Option<&'a V> { match self.bucket_for_key(k) { FoundEntry(idx) => Some(self.value_for_bucket(idx)), @@ -418,9 +408,7 @@ impl Map for HashMap { } /// Return a mutable reference to the value corresponding to the key - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn find_mut<'a>(&'a mut self, k: &K) -> Option<&'a mut V> { let idx = match self.bucket_for_key(k) { FoundEntry(idx) => idx, @@ -534,9 +522,7 @@ pub impl HashMap { /// Return the value corresponding to the key in the map, or insert /// and return the value if it doesn't exist. - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn find_or_insert<'a>(&'a mut self, k: K, v: V) -> &'a V { if self.size >= self.resize_at { // n.b.: We could also do this after searching, so @@ -599,9 +585,7 @@ pub impl HashMap { /// Return the value corresponding to the key in the map, or create, /// insert, and return a new value if it doesn't exist. - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn find_or_insert_with<'a>(&'a mut self, k: K, f: &fn(&K) -> V) -> &'a V { if self.size >= self.resize_at { // n.b.: We could also do this after searching, so @@ -655,9 +639,7 @@ pub impl HashMap { } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn get<'a>(&'a self, k: &K) -> &'a V { match self.find(k) { Some(v) => v, @@ -686,9 +668,7 @@ pub impl HashMap { /// Return the value corresponding to the key in the map, using /// equivalence - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn find_equiv<'a, Q:Hash + Equiv>(&'a self, k: &Q) -> Option<&'a V> { match self.bucket_for_key_equiv(k) { FoundEntry(idx) => Some(self.value_for_bucket(idx)), diff --git a/src/libcore/num/num.rs b/src/libcore/num/num.rs index b8f47db7d128e..711f849efb2b6 100644 --- a/src/libcore/num/num.rs +++ b/src/libcore/num/num.rs @@ -405,9 +405,7 @@ pub fn test_num(ten: T, two: T) { assert_eq!(ten.div(&two), ten / two); assert_eq!(ten.modulo(&two), ten % two); } -#[cfg(stage1,test)] -#[cfg(stage2,test)] -#[cfg(stage3,test)] +#[cfg(not(stage0), test)] pub fn test_num(ten: T, two: T) { assert_eq!(ten.add(&two), cast(12)); assert_eq!(ten.sub(&two), cast(8)); diff --git a/src/libcore/num/strconv.rs b/src/libcore/num/strconv.rs index 68e3b407a8bc2..f135ead740004 100644 --- a/src/libcore/num/strconv.rs +++ b/src/libcore/num/strconv.rs @@ -13,9 +13,7 @@ use core::cmp::{Ord, Eq}; use ops::{Add, Sub, Mul, Div, Neg}; #[cfg(stage0)] use Rem = ops::Modulo; -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] use ops::{Add, Sub, Mul, Div, Rem, Neg}; use option::{None, Option, Some}; use char; diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 17192b4257b16..2c208e2fd6930 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -107,9 +107,7 @@ impl BaseIter for Option { } /// Performs an operation on the contained value by reference - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn each<'a>(&'a self, f: &fn(x: &'a T) -> bool) { match *self { None => (), Some(ref t) => { f(t); } } @@ -128,9 +126,7 @@ impl MutableIter for Option { match *self { None => (), Some(ref mut t) => { f(t); } } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn each_mut<'a>(&'a mut self, f: &fn(&'a mut T) -> bool) { match *self { None => (), Some(ref mut t) => { f(t); } } @@ -210,9 +206,7 @@ pub impl Option { * Update an optional value by optionally running its content by reference * through a function that returns an option. */ - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn chain_ref<'a, U>(&'a self, f: &fn(x: &'a T) -> Option) -> Option { match *self { Some(ref x) => f(x), None => None } @@ -226,9 +220,7 @@ pub impl Option { } /// Maps a `some` value from one type to another by reference - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn map<'a, U>(&self, f: &fn(&'a T) -> U) -> Option { match *self { Some(ref x) => Some(f(x)), None => None } @@ -249,9 +241,7 @@ pub impl Option { } /// Applies a function to the contained value or returns a default - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn map_default<'a, U>(&'a self, def: U, f: &fn(&'a T) -> U) -> U { match *self { None => def, Some(ref t) => f(t) } @@ -318,9 +308,7 @@ pub impl Option { case explicitly. */ #[inline(always)] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn get_ref<'a>(&'a self) -> &'a T { match *self { Some(ref x) => x, @@ -366,9 +354,7 @@ pub impl Option { case explicitly. */ #[inline(always)] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn get_mut_ref<'a>(&'a mut self) -> &'a mut T { match *self { Some(ref mut x) => x, diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 9171c5167bc7b..72233e3793e95 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -230,9 +230,7 @@ pub impl Result { #[inline(always)] fn get_ref(&self) -> &'self T { get_ref(self) } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn get_ref<'a>(&'a self) -> &'a T { get_ref(self) } diff --git a/src/libcore/rt/rtio.rs b/src/libcore/rt/rtio.rs index 66eb79ba6ae4e..595e663006d1b 100644 --- a/src/libcore/rt/rtio.rs +++ b/src/libcore/rt/rtio.rs @@ -26,9 +26,7 @@ pub trait EventLoop { /// The asynchronous I/O services. Not all event loops may provide one #[cfg(stage0)] fn io(&mut self) -> Option<&'self mut IoFactoryObject>; - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn io<'a>(&'a mut self) -> Option<&'a mut IoFactoryObject>; } diff --git a/src/libcore/rt/uvio.rs b/src/libcore/rt/uvio.rs index abdd8d6619a8a..18e50516c5b22 100644 --- a/src/libcore/rt/uvio.rs +++ b/src/libcore/rt/uvio.rs @@ -74,9 +74,7 @@ impl EventLoop for UvEventLoop { Some(&mut self.uvio) } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn io<'a>(&'a mut self) -> Option<&'a mut IoFactoryObject> { Some(&mut self.uvio) } @@ -104,9 +102,7 @@ pub impl UvIoFactory { match self { &UvIoFactory(ref mut ptr) => ptr } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn uv_loop<'a>(&'a mut self) -> &'a mut Loop { match self { &UvIoFactory(ref mut ptr) => ptr } } diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 064bffa00561f..46c850d4a983a 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -2356,9 +2356,7 @@ pub trait StrSlice<'self> { fn any(&self, it: &fn(char) -> bool) -> bool; fn contains<'a>(&self, needle: &'a str) -> bool; fn contains_char(&self, needle: char) -> bool; - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn char_iter(&self) -> StrCharIterator<'self>; fn each(&self, it: &fn(u8) -> bool); fn eachi(&self, it: &fn(uint, u8) -> bool); @@ -2420,9 +2418,7 @@ impl<'self> StrSlice<'self> for &'self str { contains_char(*self, needle) } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline] fn char_iter(&self) -> StrCharIterator<'self> { StrCharIterator { @@ -2615,17 +2611,13 @@ impl Clone for ~str { } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub struct StrCharIterator<'self> { priv index: uint, priv string: &'self str, } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl<'self> Iterator for StrCharIterator<'self> { #[inline] fn next(&mut self) -> Option { diff --git a/src/libcore/trie.rs b/src/libcore/trie.rs index f4e9ddbdd90a1..b7a1f0ee1fd6c 100644 --- a/src/libcore/trie.rs +++ b/src/libcore/trie.rs @@ -63,9 +63,7 @@ impl Map for TrieMap { /// Visit all key-value pairs in order #[inline(always)] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each<'a>(&'a self, f: &fn(&uint, &'a T) -> bool) { self.root.each(f); } @@ -85,9 +83,7 @@ impl Map for TrieMap { /// Visit all values in order #[inline(always)] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each_value<'a>(&'a self, f: &fn(&'a T) -> bool) { self.each(|_, v| f(v)) } @@ -121,9 +117,7 @@ impl Map for TrieMap { } /// Return a reference to the value corresponding to the key - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(hint)] fn find<'a>(&'a self, key: &uint) -> Option<&'a T> { let mut node: &'a TrieNode = &self.root; @@ -152,9 +146,7 @@ impl Map for TrieMap { } /// Return a mutable reference to the value corresponding to the key - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] #[inline(always)] fn find_mut<'a>(&'a mut self, key: &uint) -> Option<&'a mut T> { find_mut(&mut self.root.children[chunk(*key, 0)], *key, 1) @@ -200,9 +192,7 @@ pub impl TrieMap { /// Visit all key-value pairs in reverse order #[inline(always)] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each_reverse<'a>(&'a self, f: &fn(&uint, &'a T) -> bool) { self.root.each_reverse(f); } @@ -310,9 +300,7 @@ impl TrieNode { true } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each<'a>(&'a self, f: &fn(&uint, &'a T) -> bool) -> bool { for uint::range(0, self.children.len()) |idx| { match self.children[idx] { @@ -336,9 +324,7 @@ impl TrieNode { true } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each_reverse<'a>(&'a self, f: &fn(&uint, &'a T) -> bool) -> bool { for uint::range_rev(self.children.len(), 0) |idx| { match self.children[idx - 1] { diff --git a/src/libcore/tuple.rs b/src/libcore/tuple.rs index a2b6f0eb1a714..0d54ad1af66a3 100644 --- a/src/libcore/tuple.rs +++ b/src/libcore/tuple.rs @@ -78,17 +78,13 @@ impl ImmutableTuple for (T, U) { } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub trait ImmutableTuple { fn first_ref<'a>(&'a self) -> &'a T; fn second_ref<'a>(&'a self) -> &'a U; } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl ImmutableTuple for (T, U) { #[inline(always)] fn first_ref<'a>(&'a self) -> &'a T { diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 86767dc5bad85..8cec4cc6b4c6e 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -19,9 +19,7 @@ use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater}; use clone::Clone; use old_iter::BaseIter; use old_iter; -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] use iterator::Iterator; use kinds::Copy; use libc; @@ -1590,9 +1588,7 @@ pub fn windowed(n: uint, v: &[T], it: &fn(&[T]) -> bool) { * ~~~ * */ -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub fn windowed<'r, T>(n: uint, v: &'r [T], it: &fn(&'r [T]) -> bool) { assert!(1u <= n); if n > v.len() { return; } @@ -1995,9 +1991,7 @@ impl<'self,T> ImmutableVector for &'self [T] { } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub trait ImmutableVector<'self, T> { fn slice(&self, start: uint, end: uint) -> &'self [T]; fn iter(self) -> VecIterator<'self, T>; @@ -2022,9 +2016,7 @@ pub trait ImmutableVector<'self, T> { } /// Extension methods for vectors -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl<'self,T> ImmutableVector<'self, T> for &'self [T] { /// Return a slice that points into another slice. #[inline] @@ -2642,9 +2634,7 @@ impl<'self,A> old_iter::BaseIter for &'self [A] { fn size_hint(&self) -> Option { Some(self.len()) } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl<'self,A> old_iter::BaseIter for &'self [A] { #[inline(always)] fn each<'a>(&'a self, blk: &fn(v: &'a A) -> bool) { each(*self, blk) } @@ -2662,9 +2652,7 @@ impl old_iter::BaseIter for ~[A] { } // FIXME(#4148): This should be redundant -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl old_iter::BaseIter for ~[A] { #[inline(always)] fn each<'a>(&'a self, blk: &fn(v: &'a A) -> bool) { each(*self, blk) } @@ -2682,9 +2670,7 @@ impl old_iter::BaseIter for @[A] { } // FIXME(#4148): This should be redundant -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl old_iter::BaseIter for @[A] { #[inline(always)] fn each<'a>(&'a self, blk: &fn(v: &'a A) -> bool) { each(*self, blk) } @@ -2700,9 +2686,7 @@ impl<'self,A> old_iter::MutableIter for &'self mut [A] { } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl<'self,A> old_iter::MutableIter for &'self mut [A] { #[inline(always)] fn each_mut<'a>(&'a mut self, blk: &fn(v: &'a mut A) -> bool) { @@ -2719,9 +2703,7 @@ impl old_iter::MutableIter for ~[A] { } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl old_iter::MutableIter for ~[A] { #[inline(always)] fn each_mut<'a>(&'a mut self, blk: &fn(v: &'a mut A) -> bool) { @@ -2927,18 +2909,14 @@ impl Clone for ~[A] { } // could be implemented with &[T] with .slice(), but this avoids bounds checks -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub struct VecIterator<'self, T> { priv ptr: *T, priv end: *T, priv lifetime: &'self T // FIXME: #5922 } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl<'self, T> Iterator<&'self T> for VecIterator<'self, T> { #[inline] fn next(&mut self) -> Option<&'self T> { diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 2f753523a7bc0..b6484fcbd80d2 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -551,9 +551,7 @@ fn encode_method_map_entry(ecx: @e::EncodeContext, } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] fn encode_method_map_entry(ecx: @e::EncodeContext, ebml_w: &writer::Encoder, mme: method_map_entry) { @@ -599,9 +597,7 @@ impl read_method_map_entry_helper for reader::Decoder { } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn read_method_map_entry(&self, xcx: @ExtendedDecodeContext) -> method_map_entry { do self.read_struct("method_map_entry", 3) { @@ -839,9 +835,7 @@ impl ebml_writer_helpers for writer::Encoder { } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn emit_tpbt(&self, ecx: @e::EncodeContext, tpbt: ty::ty_param_bounds_and_ty) { do self.emit_struct("ty_param_bounds_and_ty", 2) { @@ -1123,9 +1117,7 @@ impl ebml_decoder_decoder_helpers for reader::Decoder { } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn read_ty_param_bounds_and_ty(&self, xcx: @ExtendedDecodeContext) -> ty::ty_param_bounds_and_ty { diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs index 8e2c734504512..72fe23a97ea1b 100644 --- a/src/libstd/arena.rs +++ b/src/libstd/arena.rs @@ -213,9 +213,7 @@ pub impl Arena { } #[inline(always)] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] priv fn alloc_pod<'a, T>(&'a self, op: &fn() -> T) -> &'a T { unsafe { let tydesc = sys::get_type_desc::(); @@ -283,9 +281,7 @@ pub impl Arena { } #[inline(always)] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] priv fn alloc_nonpod<'a, T>(&'a self, op: &fn() -> T) -> &'a T { unsafe { let tydesc = sys::get_type_desc::(); @@ -321,9 +317,7 @@ pub impl Arena { // The external interface #[inline(always)] - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn alloc<'a, T>(&'a self, op: &fn() -> T) -> &'a T { unsafe { if !rusti::needs_drop::() { diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 5d52bb7c0810b..9ea202a1296d4 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -54,9 +54,7 @@ pub impl Deque { /// Return a reference to the first element in the deque /// /// Fails if the deque is empty - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn peek_front<'a>(&'a self) -> &'a T { get(self.elts, self.lo) } /// Return a reference to the last element in the deque @@ -68,9 +66,7 @@ pub impl Deque { /// Return a reference to the last element in the deque /// /// Fails if the deque is empty - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn peek_back<'a>(&'a self) -> &'a T { get(self.elts, self.hi - 1u) } /// Retrieve an element in the deque by index @@ -85,9 +81,7 @@ pub impl Deque { /// Retrieve an element in the deque by index /// /// Fails if there is no element with the given index - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn get<'a>(&'a self, i: int) -> &'a T { let idx = (self.lo + (i as uint)) % self.elts.len(); get(self.elts, idx) @@ -156,9 +150,7 @@ pub impl Deque { } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] pub impl Deque { /// Create an empty Deque fn new() -> Deque { diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs index 2598e96a141e2..e6b4907dc4d10 100644 --- a/src/libstd/ebml.rs +++ b/src/libstd/ebml.rs @@ -407,9 +407,7 @@ pub mod reader { f() } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn read_struct_field(&self, name: &str, idx: uint, f: &fn() -> T) -> T { debug!("read_struct_field(name=%?, idx=%u)", name, idx); self._check_label(name); @@ -719,9 +717,7 @@ pub mod writer { self._emit_label(name); f() } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn emit_struct_field(&self, name: &str, _idx: uint, f: &fn()) { self._emit_label(name); f() diff --git a/src/libstd/future.rs b/src/libstd/future.rs index f59abfa81ca10..c2864b762f6f1 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -80,9 +80,7 @@ pub impl Future { } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn get_ref<'a>(&'a self) -> &'a A { /*! * Executes the future's closure and then returns a borrowed diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 7353bec7333c5..401a1a90fc838 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -150,9 +150,7 @@ impl serialize::Encoder for Encoder { self.wr.write_char(':'); f(); } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn emit_struct_field(&self, name: &str, idx: uint, f: &fn()) { if idx != 0 { self.wr.write_char(','); } self.wr.write_str(escape_str(name)); @@ -301,9 +299,7 @@ impl serialize::Encoder for PrettyEncoder { self.wr.write_str(": "); f(); } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn emit_struct_field(&self, name: &str, idx: uint, f: &fn()) { if idx == 0 { self.wr.write_char('\n'); @@ -921,9 +917,7 @@ impl serialize::Decoder for Decoder { } } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn read_struct_field(&self, name: &str, idx: uint, f: &fn() -> T) -> T { debug!("read_struct_field(name=%?, idx=%u)", name, idx); match self.stack.pop() { diff --git a/src/libstd/priority_queue.rs b/src/libstd/priority_queue.rs index 47af3576c9062..bd8077fc27f8e 100644 --- a/src/libstd/priority_queue.rs +++ b/src/libstd/priority_queue.rs @@ -49,9 +49,7 @@ pub impl PriorityQueue { fn top(&self) -> &'self T { &self.data[0] } /// Returns the greatest item in the queue - fails if empty - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn top<'a>(&'a self) -> &'a T { &self.data[0] } /// Returns the greatest item in the queue - None if empty @@ -61,9 +59,7 @@ pub impl PriorityQueue { } /// Returns the greatest item in the queue - None if empty - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn maybe_top<'a>(&'a self) -> Option<&'a T> { if self.is_empty() { None } else { Some(self.top()) } } diff --git a/src/libstd/serialize.rs b/src/libstd/serialize.rs index 1ad581ba993e4..34ee36fda0d92 100644 --- a/src/libstd/serialize.rs +++ b/src/libstd/serialize.rs @@ -20,9 +20,7 @@ use core::hashmap::{HashMap, HashSet}; use core::trie::{TrieMap, TrieSet}; use deque::Deque; use dlist::DList; -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] use treemap::{TreeMap, TreeSet}; pub trait Encoder { @@ -57,9 +55,7 @@ pub trait Encoder { fn emit_struct(&self, name: &str, len: uint, f: &fn()); #[cfg(stage0)] fn emit_field(&self, f_name: &str, f_idx: uint, f: &fn()); - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn emit_struct_field(&self, f_name: &str, f_idx: uint, f: &fn()); fn emit_tuple(&self, len: uint, f: &fn()); @@ -113,9 +109,7 @@ pub trait Decoder { fn read_struct(&self, s_name: &str, len: uint, f: &fn() -> T) -> T; #[cfg(stage0)] fn read_field(&self, f_name: &str, f_idx: uint, f: &fn() -> T) -> T; - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn read_struct_field(&self, f_name: &str, f_idx: uint, f: &fn() -> T) -> T; fn read_tuple(&self, f: &fn(uint) -> T) -> T; @@ -740,9 +734,7 @@ impl Decodable for TrieSet { } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl< E: Encoder, K: Encodable + Eq + TotalOrd, @@ -760,9 +752,7 @@ impl< } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl< D: Decoder, K: Decodable + Eq + TotalOrd, @@ -781,9 +771,7 @@ impl< } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl< S: Encoder, T: Encodable + Eq + TotalOrd @@ -799,9 +787,7 @@ impl< } } -#[cfg(stage1)] -#[cfg(stage2)] -#[cfg(stage3)] +#[cfg(not(stage0))] impl< D: Decoder, T: Decodable + Eq + TotalOrd diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs index fb17d4e50900c..af073d281828d 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -61,9 +61,7 @@ impl Map for SmallIntMap { } /// Visit all key-value pairs in order - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each<'a>(&'a self, it: &fn(&uint, &'a V) -> bool) { for uint::range(0, self.v.len()) |i| { match self.v[i] { @@ -85,9 +83,7 @@ impl Map for SmallIntMap { } /// Visit all values in order - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each_value<'a>(&'a self, blk: &fn(value: &'a V) -> bool) { self.each(|_, v| blk(v)) } @@ -116,9 +112,7 @@ impl Map for SmallIntMap { } /// Return a reference to the value corresponding to the key - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn find<'a>(&'a self, key: &uint) -> Option<&'a V> { if *key < self.v.len() { match self.v[*key] { @@ -144,9 +138,7 @@ impl Map for SmallIntMap { } /// Return a mutable reference to the value corresponding to the key - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn find_mut<'a>(&'a mut self, key: &uint) -> Option<&'a mut V> { if *key < self.v.len() { match self.v[*key] { @@ -199,9 +191,7 @@ pub impl SmallIntMap { } /// Visit all key-value pairs in reverse order - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn each_reverse<'a>(&'a self, it: &fn(uint, &'a V) -> bool) { for uint::range_rev(self.v.len(), 0) |i| { match self.v[i - 1] { @@ -216,9 +206,7 @@ pub impl SmallIntMap { self.find(key).expect("key not present") } - #[cfg(stage1)] - #[cfg(stage2)] - #[cfg(stage3)] + #[cfg(not(stage0))] fn get<'a>(&'a self, key: &uint) -> &'a V { self.find(key).expect("key not present") }