about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-09-16 23:34:40 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-09-18 11:07:22 -0700
commit817576ee7001244da68a4ee315ebdc1163d4e648 (patch)
treeffa6ecd790e899105cfa3f2c2da1b4520a062f72 /src/libstd
parente02313a172acca34bd29e10cdd10f7495664694e (diff)
downloadrust-817576ee7001244da68a4ee315ebdc1163d4e648.tar.gz
rust-817576ee7001244da68a4ee315ebdc1163d4e648.zip
Register new snapshots
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/c_str.rs4
-rw-r--r--src/libstd/logging.rs11
-rw-r--r--src/libstd/os.rs12
-rw-r--r--src/libstd/ptr.rs87
-rw-r--r--src/libstd/rand.rs2
-rw-r--r--src/libstd/reflect_stage0.rs493
-rw-r--r--src/libstd/repr_stage0.rs626
-rw-r--r--src/libstd/rt/args.rs12
-rw-r--r--src/libstd/rt/io/buffered.rs4
-rw-r--r--src/libstd/rt/io/mod.rs8
-rw-r--r--src/libstd/rt/mod.rs12
-rw-r--r--src/libstd/rt/task.rs11
-rw-r--r--src/libstd/rt/uv/uvll.rs41
-rw-r--r--src/libstd/run.rs2
-rw-r--r--src/libstd/std.rs6
-rw-r--r--src/libstd/sys.rs9
-rw-r--r--src/libstd/unstable/intrinsics.rs101
-rw-r--r--src/libstd/unstable/sync.rs17
18 files changed, 13 insertions, 1445 deletions
diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs
index 75598b300a3..67b5aff8466 100644
--- a/src/libstd/c_str.rs
+++ b/src/libstd/c_str.rs
@@ -30,9 +30,7 @@ pub enum NullByteResolution {
 
 condition! {
     // This should be &[u8] but there's a lifetime issue (#5370).
-    // NOTE: this super::NullByteResolution should be NullByteResolution
-    // Change this next time the snapshot is updated.
-    pub null_byte: (~[u8]) -> super::NullByteResolution;
+    pub null_byte: (~[u8]) -> NullByteResolution;
 }
 
 /// The representation of a C String.
diff --git a/src/libstd/logging.rs b/src/libstd/logging.rs
index b39b3102a34..1a463a499cb 100644
--- a/src/libstd/logging.rs
+++ b/src/libstd/logging.rs
@@ -37,17 +37,6 @@ pub fn console_off() {
     rt::logging::console_off();
 }
 
-#[cfg(not(test), stage0)]
-#[lang="log_type"]
-#[allow(missing_doc)]
-pub fn log_type<T>(_level: u32, object: &T) {
-    use sys;
-
-    // XXX: Bad allocation
-    let msg = sys::log_str(object);
-    newsched_log_str(msg);
-}
-
 fn newsched_log_str(msg: ~str) {
     use rt::task::Task;
     use rt::local::Local;
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index 215bda264ad..e58acf70ca4 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -148,18 +148,6 @@ pub mod win32 {
     }
 }
 
-#[cfg(stage0)]
-mod macro_hack {
-#[macro_escape];
-macro_rules! externfn(
-    (fn $name:ident ()) => (
-        extern {
-            fn $name();
-        }
-    )
-)
-}
-
 /*
 Accessing environment variables is not generally threadsafe.
 Serialize access through a global lock.
diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs
index 6e90e2a1070..135acb106a1 100644
--- a/src/libstd/ptr.rs
+++ b/src/libstd/ptr.rs
@@ -16,31 +16,13 @@ use clone::Clone;
 use cmp::Equiv;
 use iter::{range, Iterator};
 use option::{Option, Some, None};
-#[cfg(stage0)]
-use sys;
 use unstable::intrinsics;
 use util::swap;
 
 #[cfg(not(test))] use cmp::{Eq, Ord};
 
-/// Calculate the offset from a pointer. The count *must* be in bounds or
-/// otherwise the loads of this address are undefined.
-#[inline]
-#[cfg(stage0)]
-pub unsafe fn offset<T>(ptr: *T, count: int) -> *T {
-    (ptr as uint + (count as uint) * sys::size_of::<T>()) as *T
-}
-
-/// Calculate the offset from a mut pointer
-#[inline]
-#[cfg(stage0)]
-pub unsafe fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T {
-    (ptr as uint + (count as uint) * sys::size_of::<T>()) as *mut T
-}
-
 /// Calculate the offset from a pointer
 #[inline]
-#[cfg(not(stage0))]
 pub unsafe fn offset<T>(ptr: *T, count: int) -> *T {
     intrinsics::offset(ptr, count)
 }
@@ -48,7 +30,6 @@ pub unsafe fn offset<T>(ptr: *T, count: int) -> *T {
 /// Calculate the offset from a mut pointer. The count *must* be in bounds or
 /// otherwise the loads of this address are undefined.
 #[inline]
-#[cfg(not(stage0))]
 pub unsafe fn mut_offset<T>(ptr: *mut T, count: int) -> *mut T {
     intrinsics::offset(ptr as *T, count) as *mut T
 }
@@ -383,17 +364,7 @@ impl<T> RawPtr<T> for *mut T {
 }
 
 // Equality for pointers
-#[cfg(stage0, not(test))]
-impl<T> Eq for *T {
-    #[inline]
-    fn eq(&self, other: &*T) -> bool {
-        (*self as uint) == (*other as uint)
-    }
-    #[inline]
-    fn ne(&self, other: &*T) -> bool { !self.eq(other) }
-}
-
-#[cfg(not(stage0), not(test))]
+#[cfg(not(test))]
 impl<T> Eq for *T {
     #[inline]
     fn eq(&self, other: &*T) -> bool {
@@ -403,17 +374,7 @@ impl<T> Eq for *T {
     fn ne(&self, other: &*T) -> bool { !self.eq(other) }
 }
 
-#[cfg(stage0, not(test))]
-impl<T> Eq for *mut T {
-    #[inline]
-    fn eq(&self, other: &*mut T) -> bool {
-        (*self as uint) == (*other as uint)
-    }
-    #[inline]
-    fn ne(&self, other: &*mut T) -> bool { !self.eq(other) }
-}
-
-#[cfg(not(stage0), not(test))]
+#[cfg(not(test))]
 impl<T> Eq for *mut T {
     #[inline]
     fn eq(&self, other: &*mut T) -> bool {
@@ -480,27 +441,7 @@ mod externfnpointers {
 }
 
 // Comparison for pointers
-#[cfg(stage0, not(test))]
-impl<T> Ord for *T {
-    #[inline]
-    fn lt(&self, other: &*T) -> bool {
-        (*self as uint) < (*other as uint)
-    }
-    #[inline]
-    fn le(&self, other: &*T) -> bool {
-        (*self as uint) <= (*other as uint)
-    }
-    #[inline]
-    fn ge(&self, other: &*T) -> bool {
-        (*self as uint) >= (*other as uint)
-    }
-    #[inline]
-    fn gt(&self, other: &*T) -> bool {
-        (*self as uint) > (*other as uint)
-    }
-}
-
-#[cfg(not(stage0), not(test))]
+#[cfg(not(test))]
 impl<T> Ord for *T {
     #[inline]
     fn lt(&self, other: &*T) -> bool {
@@ -520,27 +461,7 @@ impl<T> Ord for *T {
     }
 }
 
-#[cfg(stage0, not(test))]
-impl<T> Ord for *mut T {
-    #[inline]
-    fn lt(&self, other: &*mut T) -> bool {
-        (*self as uint) < (*other as uint)
-    }
-    #[inline]
-    fn le(&self, other: &*mut T) -> bool {
-        (*self as uint) <= (*other as uint)
-    }
-    #[inline]
-    fn ge(&self, other: &*mut T) -> bool {
-        (*self as uint) >= (*other as uint)
-    }
-    #[inline]
-    fn gt(&self, other: &*mut T) -> bool {
-        (*self as uint) > (*other as uint)
-    }
-}
-
-#[cfg(not(stage0), not(test))]
+#[cfg(not(test))]
 impl<T> Ord for *mut T {
     #[inline]
     fn lt(&self, other: &*mut T) -> bool {
diff --git a/src/libstd/rand.rs b/src/libstd/rand.rs
index 1330096ee36..8ca247edb59 100644
--- a/src/libstd/rand.rs
+++ b/src/libstd/rand.rs
@@ -915,7 +915,7 @@ pub fn seed() -> ~[u8] {
 }
 
 // used to make space in TLS for a random number generator
-static tls_rng_state: local_data::Key<@@mut IsaacRng> = &local_data::Key;
+local_data_key!(tls_rng_state: @@mut IsaacRng)
 
 /**
  * Gives back a lazily initialized task-local random number generator,
diff --git a/src/libstd/reflect_stage0.rs b/src/libstd/reflect_stage0.rs
deleted file mode 100644
index 56e0f83e05c..00000000000
--- a/src/libstd/reflect_stage0.rs
+++ /dev/null
@@ -1,493 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-/*!
-
-Runtime type reflection
-
-*/
-
-#[allow(missing_doc)];
-
-use unstable::intrinsics::{Opaque, TyDesc, TyVisitor};
-use libc::c_void;
-use sys;
-use unstable::raw;
-
-/**
- * Trait for visitor that wishes to reflect on data. To use this, create a
- * struct that encapsulates the set of pointers you wish to walk through a
- * data structure, and implement both `MovePtr` for it as well as `TyVisitor`;
- * then build a MovePtrAdaptor wrapped around your struct.
- */
-pub trait MovePtr {
-    fn move_ptr(&self, adjustment: &fn(*c_void) -> *c_void);
-    fn push_ptr(&self);
-    fn pop_ptr(&self);
-}
-
-/// Helper function for alignment calculation.
-#[inline]
-pub fn align(size: uint, align: uint) -> uint {
-    ((size + align) - 1u) & !(align - 1u)
-}
-
-/// Adaptor to wrap around visitors implementing MovePtr.
-pub struct MovePtrAdaptor<V> {
-    inner: V
-}
-pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
-    MovePtrAdaptor { inner: v }
-}
-
-impl<V:TyVisitor + MovePtr> MovePtrAdaptor<V> {
-    #[inline]
-    pub fn bump(&self, sz: uint) {
-        do self.inner.move_ptr() |p| {
-            ((p as uint) + sz) as *c_void
-        };
-    }
-
-    #[inline]
-    pub fn align(&self, a: uint) {
-        do self.inner.move_ptr() |p| {
-            align(p as uint, a) as *c_void
-        };
-    }
-
-    #[inline]
-    pub fn align_to<T>(&self) {
-        self.align(sys::min_align_of::<T>());
-    }
-
-    #[inline]
-    pub fn bump_past<T>(&self) {
-        self.bump(sys::size_of::<T>());
-    }
-}
-
-/// Abstract type-directed pointer-movement using the MovePtr trait
-impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
-    fn visit_bot(&self) -> bool {
-        self.align_to::<()>();
-        if ! self.inner.visit_bot() { return false; }
-        self.bump_past::<()>();
-        true
-    }
-
-    fn visit_nil(&self) -> bool {
-        self.align_to::<()>();
-        if ! self.inner.visit_nil() { return false; }
-        self.bump_past::<()>();
-        true
-    }
-
-    fn visit_bool(&self) -> bool {
-        self.align_to::<bool>();
-        if ! self.inner.visit_bool() { return false; }
-        self.bump_past::<bool>();
-        true
-    }
-
-    fn visit_int(&self) -> bool {
-        self.align_to::<int>();
-        if ! self.inner.visit_int() { return false; }
-        self.bump_past::<int>();
-        true
-    }
-
-    fn visit_i8(&self) -> bool {
-        self.align_to::<i8>();
-        if ! self.inner.visit_i8() { return false; }
-        self.bump_past::<i8>();
-        true
-    }
-
-    fn visit_i16(&self) -> bool {
-        self.align_to::<i16>();
-        if ! self.inner.visit_i16() { return false; }
-        self.bump_past::<i16>();
-        true
-    }
-
-    fn visit_i32(&self) -> bool {
-        self.align_to::<i32>();
-        if ! self.inner.visit_i32() { return false; }
-        self.bump_past::<i32>();
-        true
-    }
-
-    fn visit_i64(&self) -> bool {
-        self.align_to::<i64>();
-        if ! self.inner.visit_i64() { return false; }
-        self.bump_past::<i64>();
-        true
-    }
-
-    fn visit_uint(&self) -> bool {
-        self.align_to::<uint>();
-        if ! self.inner.visit_uint() { return false; }
-        self.bump_past::<uint>();
-        true
-    }
-
-    fn visit_u8(&self) -> bool {
-        self.align_to::<u8>();
-        if ! self.inner.visit_u8() { return false; }
-        self.bump_past::<u8>();
-        true
-    }
-
-    fn visit_u16(&self) -> bool {
-        self.align_to::<u16>();
-        if ! self.inner.visit_u16() { return false; }
-        self.bump_past::<u16>();
-        true
-    }
-
-    fn visit_u32(&self) -> bool {
-        self.align_to::<u32>();
-        if ! self.inner.visit_u32() { return false; }
-        self.bump_past::<u32>();
-        true
-    }
-
-    fn visit_u64(&self) -> bool {
-        self.align_to::<u64>();
-        if ! self.inner.visit_u64() { return false; }
-        self.bump_past::<u64>();
-        true
-    }
-
-    fn visit_float(&self) -> bool {
-        self.align_to::<float>();
-        if ! self.inner.visit_float() { return false; }
-        self.bump_past::<float>();
-        true
-    }
-
-    fn visit_f32(&self) -> bool {
-        self.align_to::<f32>();
-        if ! self.inner.visit_f32() { return false; }
-        self.bump_past::<f32>();
-        true
-    }
-
-    fn visit_f64(&self) -> bool {
-        self.align_to::<f64>();
-        if ! self.inner.visit_f64() { return false; }
-        self.bump_past::<f64>();
-        true
-    }
-
-    fn visit_char(&self) -> bool {
-        self.align_to::<char>();
-        if ! self.inner.visit_char() { return false; }
-        self.bump_past::<char>();
-        true
-    }
-
-    fn visit_estr_box(&self) -> bool {
-        self.align_to::<@str>();
-        if ! self.inner.visit_estr_box() { return false; }
-        self.bump_past::<@str>();
-        true
-    }
-
-    fn visit_estr_uniq(&self) -> bool {
-        self.align_to::<~str>();
-        if ! self.inner.visit_estr_uniq() { return false; }
-        self.bump_past::<~str>();
-        true
-    }
-
-    fn visit_estr_slice(&self) -> bool {
-        self.align_to::<&'static str>();
-        if ! self.inner.visit_estr_slice() { return false; }
-        self.bump_past::<&'static str>();
-        true
-    }
-
-    fn visit_estr_fixed(&self, n: uint,
-                        sz: uint,
-                        align: uint) -> bool {
-        self.align(align);
-        if ! self.inner.visit_estr_fixed(n, sz, align) { return false; }
-        self.bump(sz);
-        true
-    }
-
-    fn visit_box(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<@u8>();
-        if ! self.inner.visit_box(mtbl, inner) { return false; }
-        self.bump_past::<@u8>();
-        true
-    }
-
-    fn visit_uniq(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<~u8>();
-        if ! self.inner.visit_uniq(mtbl, inner) { return false; }
-        self.bump_past::<~u8>();
-        true
-    }
-
-    fn visit_uniq_managed(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<~u8>();
-        if ! self.inner.visit_uniq_managed(mtbl, inner) { return false; }
-        self.bump_past::<~u8>();
-        true
-    }
-
-    fn visit_ptr(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<*u8>();
-        if ! self.inner.visit_ptr(mtbl, inner) { return false; }
-        self.bump_past::<*u8>();
-        true
-    }
-
-    fn visit_rptr(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<&'static u8>();
-        if ! self.inner.visit_rptr(mtbl, inner) { return false; }
-        self.bump_past::<&'static u8>();
-        true
-    }
-
-    fn visit_unboxed_vec(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<raw::Vec<()>>();
-        if ! self.inner.visit_vec(mtbl, inner) { return false; }
-        true
-    }
-
-    fn visit_vec(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<~[u8]>();
-        if ! self.inner.visit_vec(mtbl, inner) { return false; }
-        self.bump_past::<~[u8]>();
-        true
-    }
-
-    fn visit_evec_box(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<@[u8]>();
-        if ! self.inner.visit_evec_box(mtbl, inner) { return false; }
-        self.bump_past::<@[u8]>();
-        true
-    }
-
-    fn visit_evec_uniq(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<~[u8]>();
-        if ! self.inner.visit_evec_uniq(mtbl, inner) { return false; }
-        self.bump_past::<~[u8]>();
-        true
-    }
-
-    fn visit_evec_uniq_managed(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<~[@u8]>();
-        if ! self.inner.visit_evec_uniq_managed(mtbl, inner) { return false; }
-        self.bump_past::<~[@u8]>();
-        true
-    }
-
-    fn visit_evec_slice(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.align_to::<&'static [u8]>();
-        if ! self.inner.visit_evec_slice(mtbl, inner) { return false; }
-        self.bump_past::<&'static [u8]>();
-        true
-    }
-
-    fn visit_evec_fixed(&self, n: uint, sz: uint, align: uint,
-                        mtbl: uint, inner: *TyDesc) -> bool {
-        self.align(align);
-        if ! self.inner.visit_evec_fixed(n, sz, align, mtbl, inner) {
-            return false;
-        }
-        self.bump(sz);
-        true
-    }
-
-    fn visit_enter_rec(&self, n_fields: uint, sz: uint, align: uint) -> bool {
-        self.align(align);
-        if ! self.inner.visit_enter_rec(n_fields, sz, align) { return false; }
-        true
-    }
-
-    fn visit_rec_field(&self, i: uint, name: &str,
-                       mtbl: uint, inner: *TyDesc) -> bool {
-        unsafe { self.align((*inner).align); }
-        if ! self.inner.visit_rec_field(i, name, mtbl, inner) {
-            return false;
-        }
-        unsafe { self.bump((*inner).size); }
-        true
-    }
-
-    fn visit_leave_rec(&self, n_fields: uint, sz: uint, align: uint) -> bool {
-        if ! self.inner.visit_leave_rec(n_fields, sz, align) { return false; }
-        true
-    }
-
-    fn visit_enter_class(&self, n_fields: uint, sz: uint, align: uint)
-                      -> bool {
-        self.align(align);
-        if ! self.inner.visit_enter_class(n_fields, sz, align) {
-            return false;
-        }
-        true
-    }
-
-    fn visit_class_field(&self, i: uint, name: &str,
-                         mtbl: uint, inner: *TyDesc) -> bool {
-        unsafe { self.align((*inner).align); }
-        if ! self.inner.visit_class_field(i, name, mtbl, inner) {
-            return false;
-        }
-        unsafe { self.bump((*inner).size); }
-        true
-    }
-
-    fn visit_leave_class(&self, n_fields: uint, sz: uint, align: uint)
-                      -> bool {
-        if ! self.inner.visit_leave_class(n_fields, sz, align) {
-            return false;
-        }
-        true
-    }
-
-    fn visit_enter_tup(&self, n_fields: uint, sz: uint, align: uint) -> bool {
-        self.align(align);
-        if ! self.inner.visit_enter_tup(n_fields, sz, align) { return false; }
-        true
-    }
-
-    fn visit_tup_field(&self, i: uint, inner: *TyDesc) -> bool {
-        unsafe { self.align((*inner).align); }
-        if ! self.inner.visit_tup_field(i, inner) { return false; }
-        unsafe { self.bump((*inner).size); }
-        true
-    }
-
-    fn visit_leave_tup(&self, n_fields: uint, sz: uint, align: uint) -> bool {
-        if ! self.inner.visit_leave_tup(n_fields, sz, align) { return false; }
-        true
-    }
-
-    fn visit_enter_fn(&self, purity: uint, proto: uint,
-                      n_inputs: uint, retstyle: uint) -> bool {
-        if ! self.inner.visit_enter_fn(purity, proto, n_inputs, retstyle) {
-            return false
-        }
-        true
-    }
-
-    fn visit_fn_input(&self, i: uint, mode: uint, inner: *TyDesc) -> bool {
-        if ! self.inner.visit_fn_input(i, mode, inner) { return false; }
-        true
-    }
-
-    fn visit_fn_output(&self, retstyle: uint, inner: *TyDesc) -> bool {
-        if ! self.inner.visit_fn_output(retstyle, inner) { return false; }
-        true
-    }
-
-    fn visit_leave_fn(&self, purity: uint, proto: uint,
-                      n_inputs: uint, retstyle: uint) -> bool {
-        if ! self.inner.visit_leave_fn(purity, proto, n_inputs, retstyle) {
-            return false;
-        }
-        true
-    }
-
-    fn visit_enter_enum(&self, n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> int,
-                        sz: uint, align: uint)
-                     -> bool {
-        self.align(align);
-        if ! self.inner.visit_enter_enum(n_variants, get_disr, sz, align) {
-            return false;
-        }
-        true
-    }
-
-    fn visit_enter_enum_variant(&self, variant: uint,
-                                disr_val: int,
-                                n_fields: uint,
-                                name: &str) -> bool {
-        if ! self.inner.visit_enter_enum_variant(variant, disr_val,
-                                                 n_fields, name) {
-            return false;
-        }
-        true
-    }
-
-    fn visit_enum_variant_field(&self, i: uint, offset: uint, inner: *TyDesc) -> bool {
-        self.inner.push_ptr();
-        self.bump(offset);
-        if ! self.inner.visit_enum_variant_field(i, offset, inner) { return false; }
-        self.inner.pop_ptr();
-        true
-    }
-
-    fn visit_leave_enum_variant(&self, variant: uint,
-                                disr_val: int,
-                                n_fields: uint,
-                                name: &str) -> bool {
-        if ! self.inner.visit_leave_enum_variant(variant, disr_val,
-                                                 n_fields, name) {
-            return false;
-        }
-        true
-    }
-
-    fn visit_leave_enum(&self, n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> int,
-                        sz: uint, align: uint) -> bool {
-        if ! self.inner.visit_leave_enum(n_variants, get_disr, sz, align) {
-            return false;
-        }
-        self.bump(sz);
-        true
-    }
-
-    fn visit_trait(&self) -> bool {
-        self.align_to::<@TyVisitor>();
-        if ! self.inner.visit_trait() { return false; }
-        self.bump_past::<@TyVisitor>();
-        true
-    }
-
-    fn visit_param(&self, i: uint) -> bool {
-        if ! self.inner.visit_param(i) { return false; }
-        true
-    }
-
-    fn visit_self(&self) -> bool {
-        self.align_to::<&'static u8>();
-        if ! self.inner.visit_self() { return false; }
-        self.align_to::<&'static u8>();
-        true
-    }
-
-    fn visit_type(&self) -> bool {
-        if ! self.inner.visit_type() { return false; }
-        true
-    }
-
-    fn visit_opaque_box(&self) -> bool {
-        self.align_to::<@u8>();
-        if ! self.inner.visit_opaque_box() { return false; }
-        self.bump_past::<@u8>();
-        true
-    }
-
-    fn visit_closure_ptr(&self, ck: uint) -> bool {
-        self.align_to::<@fn()>();
-        if ! self.inner.visit_closure_ptr(ck) { return false; }
-        self.bump_past::<@fn()>();
-        true
-    }
-}
diff --git a/src/libstd/repr_stage0.rs b/src/libstd/repr_stage0.rs
deleted file mode 100644
index cbce2005141..00000000000
--- a/src/libstd/repr_stage0.rs
+++ /dev/null
@@ -1,626 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-/*!
-
-More runtime type reflection
-
-*/
-
-#[allow(missing_doc)];
-
-use cast::transmute;
-use char;
-use container::Container;
-use io::{Writer, WriterUtil};
-use iter::Iterator;
-use libc::c_void;
-use option::{Some, None};
-use ptr;
-use reflect;
-use reflect::{MovePtr, align};
-use str::StrSlice;
-use to_str::ToStr;
-use vec::OwnedVector;
-use unstable::intrinsics::{Opaque, TyDesc, TyVisitor, get_tydesc, visit_tydesc};
-use unstable::raw;
-
-#[cfg(test)] use io;
-
-/// Helpers
-
-trait EscapedCharWriter {
-    fn write_escaped_char(&self, ch: char);
-}
-
-impl EscapedCharWriter for @Writer {
-    fn write_escaped_char(&self, ch: char) {
-        match ch {
-            '\t' => self.write_str("\\t"),
-            '\r' => self.write_str("\\r"),
-            '\n' => self.write_str("\\n"),
-            '\\' => self.write_str("\\\\"),
-            '\'' => self.write_str("\\'"),
-            '"' => self.write_str("\\\""),
-            '\x20'..'\x7e' => self.write_char(ch),
-            _ => {
-                do char::escape_unicode(ch) |c| {
-                    self.write_char(c);
-                }
-            }
-        }
-    }
-}
-
-/// Representations
-
-trait Repr {
-    fn write_repr(&self, writer: @Writer);
-}
-
-impl Repr for () {
-    fn write_repr(&self, writer: @Writer) { writer.write_str("()"); }
-}
-
-impl Repr for bool {
-    fn write_repr(&self, writer: @Writer) {
-        writer.write_str(if *self { "true" } else { "false" })
-    }
-}
-
-macro_rules! int_repr(($ty:ident) => (impl Repr for $ty {
-    fn write_repr(&self, writer: @Writer) {
-        do ::$ty::to_str_bytes(*self, 10u) |bits| {
-            writer.write(bits);
-        }
-    }
-}))
-
-int_repr!(int)
-int_repr!(i8)
-int_repr!(i16)
-int_repr!(i32)
-int_repr!(i64)
-int_repr!(uint)
-int_repr!(u8)
-int_repr!(u16)
-int_repr!(u32)
-int_repr!(u64)
-
-macro_rules! num_repr(($ty:ident) => (impl Repr for $ty {
-    fn write_repr(&self, writer: @Writer) {
-        let s = self.to_str();
-        writer.write(s.as_bytes());
-    }
-}))
-
-num_repr!(float)
-num_repr!(f32)
-num_repr!(f64)
-
-// New implementation using reflect::MovePtr
-
-enum VariantState {
-    SearchingFor(int),
-    Matched,
-    AlreadyFound
-}
-
-pub struct ReprVisitor {
-    ptr: @mut *c_void,
-    ptr_stk: @mut ~[*c_void],
-    var_stk: @mut ~[VariantState],
-    writer: @Writer
-}
-pub fn ReprVisitor(ptr: *c_void, writer: @Writer) -> ReprVisitor {
-    ReprVisitor {
-        ptr: @mut ptr,
-        ptr_stk: @mut ~[],
-        var_stk: @mut ~[],
-        writer: writer,
-    }
-}
-
-impl MovePtr for ReprVisitor {
-    #[inline]
-    fn move_ptr(&self, adjustment: &fn(*c_void) -> *c_void) {
-        *self.ptr = adjustment(*self.ptr);
-    }
-    fn push_ptr(&self) {
-        self.ptr_stk.push(*self.ptr);
-    }
-    fn pop_ptr(&self) {
-        *self.ptr = self.ptr_stk.pop();
-    }
-}
-
-impl ReprVisitor {
-    // Various helpers for the TyVisitor impl
-
-    #[inline]
-    pub fn get<T>(&self, f: &fn(&T)) -> bool {
-        unsafe {
-            f(transmute::<*c_void,&T>(*self.ptr));
-        }
-        true
-    }
-
-    #[inline]
-    pub fn visit_inner(&self, inner: *TyDesc) -> bool {
-        self.visit_ptr_inner(*self.ptr, inner)
-    }
-
-    #[inline]
-    pub fn visit_ptr_inner(&self, ptr: *c_void, inner: *TyDesc) -> bool {
-        unsafe {
-            let u = ReprVisitor(ptr, self.writer);
-            let v = reflect::MovePtrAdaptor(u);
-            visit_tydesc(inner, @v as @TyVisitor);
-            true
-        }
-    }
-
-    #[inline]
-    pub fn write<T:Repr>(&self) -> bool {
-        do self.get |v:&T| {
-            v.write_repr(self.writer);
-        }
-    }
-
-    pub fn write_escaped_slice(&self, slice: &str) {
-        self.writer.write_char('"');
-        for ch in slice.iter() {
-            self.writer.write_escaped_char(ch);
-        }
-        self.writer.write_char('"');
-    }
-
-    pub fn write_mut_qualifier(&self, mtbl: uint) {
-        if mtbl == 0 {
-            self.writer.write_str("mut ");
-        } else if mtbl == 1 {
-            // skip, this is ast::m_imm
-        } else {
-            assert_eq!(mtbl, 2);
-            self.writer.write_str("const ");
-        }
-    }
-
-    pub fn write_vec_range(&self,
-                           _mtbl: uint,
-                           ptr: *(),
-                           len: uint,
-                           inner: *TyDesc)
-                           -> bool {
-        let mut p = ptr as *u8;
-        let (sz, al) = unsafe { ((*inner).size, (*inner).align) };
-        self.writer.write_char('[');
-        let mut first = true;
-        let mut left = len;
-        // unit structs have 0 size, and don't loop forever.
-        let dec = if sz == 0 {1} else {sz};
-        while left > 0 {
-            if first {
-                first = false;
-            } else {
-                self.writer.write_str(", ");
-            }
-            self.visit_ptr_inner(p as *c_void, inner);
-            unsafe {
-                p = align(ptr::offset(p, sz as int) as uint, al) as *u8;
-            }
-            left -= dec;
-        }
-        self.writer.write_char(']');
-        true
-    }
-
-    pub fn write_unboxed_vec_repr(&self,
-                                  mtbl: uint,
-                                  v: &raw::Vec<()>,
-                                  inner: *TyDesc)
-                                  -> bool {
-        self.write_vec_range(mtbl, ptr::to_unsafe_ptr(&v.data),
-                             v.fill, inner)
-    }
-}
-
-impl TyVisitor for ReprVisitor {
-    fn visit_bot(&self) -> bool {
-        self.writer.write_str("!");
-        true
-    }
-    fn visit_nil(&self) -> bool { self.write::<()>() }
-    fn visit_bool(&self) -> bool { self.write::<bool>() }
-    fn visit_int(&self) -> bool { self.write::<int>() }
-    fn visit_i8(&self) -> bool { self.write::<i8>() }
-    fn visit_i16(&self) -> bool { self.write::<i16>() }
-    fn visit_i32(&self) -> bool { self.write::<i32>()  }
-    fn visit_i64(&self) -> bool { self.write::<i64>() }
-
-    fn visit_uint(&self) -> bool { self.write::<uint>() }
-    fn visit_u8(&self) -> bool { self.write::<u8>() }
-    fn visit_u16(&self) -> bool { self.write::<u16>() }
-    fn visit_u32(&self) -> bool { self.write::<u32>() }
-    fn visit_u64(&self) -> bool { self.write::<u64>() }
-
-    fn visit_float(&self) -> bool { self.write::<float>() }
-    fn visit_f32(&self) -> bool { self.write::<f32>() }
-    fn visit_f64(&self) -> bool { self.write::<f64>() }
-
-    fn visit_char(&self) -> bool {
-        do self.get::<char> |&ch| {
-            self.writer.write_char('\'');
-            self.writer.write_escaped_char(ch);
-            self.writer.write_char('\'');
-        }
-    }
-
-    fn visit_estr_box(&self) -> bool {
-        do self.get::<@str> |s| {
-            self.writer.write_char('@');
-            self.write_escaped_slice(*s);
-        }
-    }
-    fn visit_estr_uniq(&self) -> bool {
-        do self.get::<~str> |s| {
-            self.writer.write_char('~');
-            self.write_escaped_slice(*s);
-        }
-    }
-    fn visit_estr_slice(&self) -> bool {
-        do self.get::<&str> |s| {
-            self.write_escaped_slice(*s);
-        }
-    }
-
-    // Type no longer exists, vestigial function.
-    fn visit_estr_fixed(&self, _n: uint, _sz: uint,
-                        _align: uint) -> bool { fail!(); }
-
-    fn visit_box(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.writer.write_char('@');
-        self.write_mut_qualifier(mtbl);
-        do self.get::<&raw::Box<()>> |b| {
-            let p = ptr::to_unsafe_ptr(&b.data) as *c_void;
-            self.visit_ptr_inner(p, inner);
-        }
-    }
-
-    fn visit_uniq(&self, _mtbl: uint, inner: *TyDesc) -> bool {
-        self.writer.write_char('~');
-        do self.get::<*c_void> |b| {
-            self.visit_ptr_inner(*b, inner);
-        }
-    }
-
-    fn visit_uniq_managed(&self, _mtbl: uint, inner: *TyDesc) -> bool {
-        self.writer.write_char('~');
-        do self.get::<&raw::Box<()>> |b| {
-            let p = ptr::to_unsafe_ptr(&b.data) as *c_void;
-            self.visit_ptr_inner(p, inner);
-        }
-    }
-
-    fn visit_ptr(&self, _mtbl: uint, _inner: *TyDesc) -> bool {
-        do self.get::<*c_void> |p| {
-            self.writer.write_str(fmt!("(0x%x as *())",
-                                       *p as uint));
-        }
-    }
-
-    fn visit_rptr(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        self.writer.write_char('&');
-        self.write_mut_qualifier(mtbl);
-        do self.get::<*c_void> |p| {
-            self.visit_ptr_inner(*p, inner);
-        }
-    }
-
-    // Type no longer exists, vestigial function.
-    fn visit_vec(&self, _mtbl: uint, _inner: *TyDesc) -> bool { fail!(); }
-
-
-    fn visit_unboxed_vec(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        do self.get::<raw::Vec<()>> |b| {
-            self.write_unboxed_vec_repr(mtbl, b, inner);
-        }
-    }
-
-    fn visit_evec_box(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        do self.get::<&raw::Box<raw::Vec<()>>> |b| {
-            self.writer.write_char('@');
-            self.write_mut_qualifier(mtbl);
-            self.write_unboxed_vec_repr(mtbl, &b.data, inner);
-        }
-    }
-
-    fn visit_evec_uniq(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        do self.get::<&raw::Vec<()>> |b| {
-            self.writer.write_char('~');
-            self.write_unboxed_vec_repr(mtbl, *b, inner);
-        }
-    }
-
-    fn visit_evec_uniq_managed(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        do self.get::<&raw::Box<raw::Vec<()>>> |b| {
-            self.writer.write_char('~');
-            self.write_unboxed_vec_repr(mtbl, &b.data, inner);
-        }
-    }
-
-    fn visit_evec_slice(&self, mtbl: uint, inner: *TyDesc) -> bool {
-        do self.get::<raw::Slice<()>> |s| {
-            self.writer.write_char('&');
-            self.write_vec_range(mtbl, s.data, s.len, inner);
-        }
-    }
-
-    fn visit_evec_fixed(&self, _n: uint, sz: uint, _align: uint,
-                        mtbl: uint, inner: *TyDesc) -> bool {
-        do self.get::<()> |b| {
-            self.write_vec_range(mtbl, ptr::to_unsafe_ptr(b), sz, inner);
-        }
-    }
-
-    fn visit_enter_rec(&self, _n_fields: uint,
-                       _sz: uint, _align: uint) -> bool {
-        self.writer.write_char('{');
-        true
-    }
-
-    fn visit_rec_field(&self, i: uint, name: &str,
-                       mtbl: uint, inner: *TyDesc) -> bool {
-        if i != 0 {
-            self.writer.write_str(", ");
-        }
-        self.write_mut_qualifier(mtbl);
-        self.writer.write_str(name);
-        self.writer.write_str(": ");
-        self.visit_inner(inner);
-        true
-    }
-
-    fn visit_leave_rec(&self, _n_fields: uint,
-                       _sz: uint, _align: uint) -> bool {
-        self.writer.write_char('}');
-        true
-    }
-
-    fn visit_enter_class(&self, _n_fields: uint,
-                         _sz: uint, _align: uint) -> bool {
-        self.writer.write_char('{');
-        true
-    }
-    fn visit_class_field(&self, i: uint, name: &str,
-                         mtbl: uint, inner: *TyDesc) -> bool {
-        if i != 0 {
-            self.writer.write_str(", ");
-        }
-        self.write_mut_qualifier(mtbl);
-        self.writer.write_str(name);
-        self.writer.write_str(": ");
-        self.visit_inner(inner);
-        true
-    }
-    fn visit_leave_class(&self, _n_fields: uint,
-                         _sz: uint, _align: uint) -> bool {
-        self.writer.write_char('}');
-        true
-    }
-
-    fn visit_enter_tup(&self, _n_fields: uint,
-                       _sz: uint, _align: uint) -> bool {
-        self.writer.write_char('(');
-        true
-    }
-    fn visit_tup_field(&self, i: uint, inner: *TyDesc) -> bool {
-        if i != 0 {
-            self.writer.write_str(", ");
-        }
-        self.visit_inner(inner);
-        true
-    }
-    fn visit_leave_tup(&self, _n_fields: uint,
-                       _sz: uint, _align: uint) -> bool {
-        if _n_fields == 1 {
-            self.writer.write_char(',');
-        }
-        self.writer.write_char(')');
-        true
-    }
-
-    fn visit_enter_enum(&self,
-                        _n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> int,
-                        _sz: uint,
-                        _align: uint) -> bool {
-        let var_stk: &mut ~[VariantState] = self.var_stk;
-        let disr = unsafe {
-            get_disr(transmute(*self.ptr))
-        };
-        var_stk.push(SearchingFor(disr));
-        true
-    }
-
-    fn visit_enter_enum_variant(&self, _variant: uint,
-                                disr_val: int,
-                                n_fields: uint,
-                                name: &str) -> bool {
-        let mut write = false;
-        match self.var_stk.pop() {
-            SearchingFor(sought) => {
-                if disr_val == sought {
-                    self.var_stk.push(Matched);
-                    write = true;
-                } else {
-                    self.var_stk.push(SearchingFor(sought));
-                }
-            }
-            Matched | AlreadyFound => {
-                self.var_stk.push(AlreadyFound);
-            }
-        }
-
-        if write {
-            self.writer.write_str(name);
-            if n_fields > 0 {
-                self.writer.write_char('(');
-            }
-        }
-        true
-    }
-
-    fn visit_enum_variant_field(&self,
-                                i: uint,
-                                _offset: uint,
-                                inner: *TyDesc)
-                                -> bool {
-        match self.var_stk[self.var_stk.len() - 1] {
-            Matched => {
-                if i != 0 {
-                    self.writer.write_str(", ");
-                }
-                if ! self.visit_inner(inner) {
-                    return false;
-                }
-            }
-            _ => ()
-        }
-        true
-    }
-
-    fn visit_leave_enum_variant(&self, _variant: uint,
-                                _disr_val: int,
-                                n_fields: uint,
-                                _name: &str) -> bool {
-        match self.var_stk[self.var_stk.len() - 1] {
-            Matched => {
-                if n_fields > 0 {
-                    self.writer.write_char(')');
-                }
-            }
-            _ => ()
-        }
-        true
-    }
-
-    fn visit_leave_enum(&self,
-                        _n_variants: uint,
-                        _get_disr: extern unsafe fn(ptr: *Opaque) -> int,
-                        _sz: uint,
-                        _align: uint)
-                        -> bool {
-        let var_stk: &mut ~[VariantState] = self.var_stk;
-        match var_stk.pop() {
-            SearchingFor(*) => fail!("enum value matched no variant"),
-            _ => true
-        }
-    }
-
-    fn visit_enter_fn(&self, _purity: uint, _proto: uint,
-                      _n_inputs: uint, _retstyle: uint) -> bool { true }
-    fn visit_fn_input(&self, _i: uint, _mode: uint, _inner: *TyDesc) -> bool {
-        true
-    }
-    fn visit_fn_output(&self, _retstyle: uint, _inner: *TyDesc) -> bool {
-        true
-    }
-    fn visit_leave_fn(&self, _purity: uint, _proto: uint,
-                      _n_inputs: uint, _retstyle: uint) -> bool { true }
-
-
-    fn visit_trait(&self) -> bool { true }
-    fn visit_param(&self, _i: uint) -> bool { true }
-    fn visit_self(&self) -> bool { true }
-    fn visit_type(&self) -> bool { true }
-
-    fn visit_opaque_box(&self) -> bool {
-        self.writer.write_char('@');
-        do self.get::<&raw::Box<()>> |b| {
-            let p = ptr::to_unsafe_ptr(&b.data) as *c_void;
-            self.visit_ptr_inner(p, b.type_desc);
-        }
-    }
-
-    fn visit_closure_ptr(&self, _ck: uint) -> bool { true }
-}
-
-pub fn write_repr<T>(writer: @Writer, object: &T) {
-    unsafe {
-        let ptr = ptr::to_unsafe_ptr(object) as *c_void;
-        let tydesc = get_tydesc::<T>();
-        let u = ReprVisitor(ptr, writer);
-        let v = reflect::MovePtrAdaptor(u);
-        visit_tydesc(tydesc, @v as @TyVisitor)
-    }
-}
-
-#[cfg(test)]
-struct P {a: int, b: float}
-
-#[test]
-fn test_repr() {
-
-    fn exact_test<T>(t: &T, e:&str) {
-        let s : &str = io::with_str_writer(|w| write_repr(w, t));
-        if s != e {
-            error!("expected '%s', got '%s'",
-                   e, s);
-        }
-        assert_eq!(s, e);
-    }
-
-    exact_test(&10, "10");
-    exact_test(&true, "true");
-    exact_test(&false, "false");
-    exact_test(&1.234, "1.234");
-    exact_test(&(&"hello"), "\"hello\"");
-    exact_test(&(@"hello"), "@\"hello\"");
-    exact_test(&(~"he\u10f3llo"), "~\"he\\u10f3llo\"");
-
-    exact_test(&(@10), "@10");
-    exact_test(&(@mut 10), "@10"); // FIXME: #4210: incorrect
-    exact_test(&((@mut 10, 2)), "(@mut 10, 2)");
-    exact_test(&(~10), "~10");
-    exact_test(&(&10), "&10");
-    let mut x = 10;
-    exact_test(&(&mut x), "&mut 10");
-    exact_test(&(@mut [1, 2]), "@mut [1, 2]");
-
-    exact_test(&(1,), "(1,)");
-    exact_test(&(@[1,2,3,4,5,6,7,8]),
-               "@[1, 2, 3, 4, 5, 6, 7, 8]");
-    exact_test(&(@[1u8,2u8,3u8,4u8]),
-               "@[1, 2, 3, 4]");
-    exact_test(&(@["hi", "there"]),
-               "@[\"hi\", \"there\"]");
-    exact_test(&(~["hi", "there"]),
-               "~[\"hi\", \"there\"]");
-    exact_test(&(&["hi", "there"]),
-               "&[\"hi\", \"there\"]");
-    exact_test(&(P{a:10, b:1.234}),
-               "{a: 10, b: 1.234}");
-    exact_test(&(@P{a:10, b:1.234}),
-               "@{a: 10, b: 1.234}");
-    exact_test(&(~P{a:10, b:1.234}),
-               "~{a: 10, b: 1.234}");
-    exact_test(&(10_u8, ~"hello"),
-               "(10, ~\"hello\")");
-    exact_test(&(10_u16, ~"hello"),
-               "(10, ~\"hello\")");
-    exact_test(&(10_u32, ~"hello"),
-               "(10, ~\"hello\")");
-    exact_test(&(10_u64, ~"hello"),
-               "(10, ~\"hello\")");
-
-    struct Foo;
-    exact_test(&(~[Foo, Foo, Foo]), "~[{}, {}, {}]");
-}
diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs
index afa8d3261fc..d8317c34f50 100644
--- a/src/libstd/rt/args.rs
+++ b/src/libstd/rt/args.rs
@@ -117,18 +117,6 @@ mod imp {
         }
     }
 
-    #[cfg(stage0)]
-    mod macro_hack {
-    #[macro_escape];
-    macro_rules! externfn(
-        (fn $name:ident () $(-> $ret_ty:ty),*) => (
-            extern {
-                fn $name() $(-> $ret_ty),*;
-            }
-        )
-    )
-    }
-
     externfn!(fn rust_take_global_args_lock())
     externfn!(fn rust_drop_global_args_lock())
     externfn!(fn rust_get_global_args_ptr() -> *mut Option<~~[~str]>)
diff --git a/src/libstd/rt/io/buffered.rs b/src/libstd/rt/io/buffered.rs
index 579e581d87e..7988f640687 100644
--- a/src/libstd/rt/io/buffered.rs
+++ b/src/libstd/rt/io/buffered.rs
@@ -126,7 +126,7 @@ impl<R: Reader> Decorator<R> for BufferedReader<R> {
 
 /// Wraps a Writer and buffers output to it
 ///
-/// NOTE: `BufferedWriter` will NOT flush its buffer when dropped.
+/// Note that `BufferedWriter` will NOT flush its buffer when dropped.
 pub struct BufferedWriter<W> {
     priv inner: W,
     priv buf: ~[u8],
@@ -204,7 +204,7 @@ impl<W: Reader> Reader for InternalBufferedWriter<W> {
 
 /// Wraps a Stream and buffers input and output to and from it
 ///
-/// NOTE: `BufferedStream` will NOT flush its output buffer when dropped.
+/// Note that `BufferedStream` will NOT flush its output buffer when dropped.
 // FIXME #9155 this should be a newtype struct
 pub struct BufferedStream<S> {
     priv inner: BufferedReader<InternalBufferedWriter<S>>
diff --git a/src/libstd/rt/io/mod.rs b/src/libstd/rt/io/mod.rs
index 871b41039d1..bfec2e9bdf8 100644
--- a/src/libstd/rt/io/mod.rs
+++ b/src/libstd/rt/io/mod.rs
@@ -388,17 +388,13 @@ impl ToStr for IoErrorKind {
 // XXX: Can't put doc comments on macros
 // Raised by `I/O` operations on error.
 condition! {
-    // NOTE: this super::IoError should be IoError
-    // Change this next time the snapshot is updated.
-    pub io_error: super::IoError -> ();
+    pub io_error: IoError -> ();
 }
 
 // XXX: Can't put doc comments on macros
 // Raised by `read` on error
 condition! {
-    // NOTE: this super::IoError should be IoError
-    // Change this next time the snapshot it updated.
-    pub read_error: super::IoError -> ();
+    pub read_error: IoError -> ();
 }
 
 /// Helper for wrapper calls where you want to
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index 53f62786b62..6df857b8d55 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -198,18 +198,6 @@ pub fn start_on_main_thread(argc: int, argv: **u8, crate_map: *u8, main: ~fn())
     return exit_code;
 }
 
-#[cfg(stage0)]
-mod macro_hack {
-#[macro_escape];
-macro_rules! externfn(
-    (fn $name:ident ($($arg_name:ident : $arg_ty:ty),*) $(-> $ret_ty:ty),*) => (
-        extern {
-            fn $name($($arg_name : $arg_ty),*) $(-> $ret_ty),*;
-        }
-    )
-)
-}
-
 /// One-time runtime initialization.
 ///
 /// Initializes global state, including frobbing
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index 09f5ee7febb..09bd89ec94a 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -444,17 +444,10 @@ impl Unwinder {
         }
 
         extern {
-            #[cfg(not(stage0))]
             #[rust_stack]
             fn rust_try(f: extern "C" fn(*c_void, *c_void),
                         code: *c_void,
                         data: *c_void) -> uintptr_t;
-
-            #[cfg(stage0)]
-            #[rust_stack]
-            fn rust_try(f: *u8,
-                        code: *c_void,
-                        data: *c_void) -> uintptr_t;
         }
     }
 
@@ -490,10 +483,10 @@ mod test {
     fn tls() {
         use local_data;
         do run_in_newsched_task() {
-            static key: local_data::Key<@~str> = &local_data::Key;
+            local_data_key!(key: @~str)
             local_data::set(key, @~"data");
             assert!(*local_data::get(key, |k| k.map_move(|k| *k)).unwrap() == ~"data");
-            static key2: local_data::Key<@~str> = &local_data::Key;
+            local_data_key!(key2: @~str)
             local_data::set(key2, @~"data");
             assert!(*local_data::get(key2, |k| k.map_move(|k| *k)).unwrap() == ~"data");
         }
diff --git a/src/libstd/rt/uv/uvll.rs b/src/libstd/rt/uv/uvll.rs
index 42102a52e2e..9591fc82df4 100644
--- a/src/libstd/rt/uv/uvll.rs
+++ b/src/libstd/rt/uv/uvll.rs
@@ -31,7 +31,6 @@
 
 use c_str::ToCStr;
 use libc::{size_t, c_int, c_uint, c_void, c_char, uintptr_t};
-#[cfg(not(stage0))]
 use libc::ssize_t;
 use libc::{malloc, free};
 use libc;
@@ -149,73 +148,33 @@ impl uv_stat_t {
     }
 }
 
-#[cfg(stage0)]
-pub type uv_idle_cb = *u8;
-#[cfg(stage0)]
-pub type uv_alloc_cb = *u8;
-#[cfg(stage0)]
-pub type uv_read_cb = *u8;
-#[cfg(stage0)]
-pub type uv_udp_send_cb = *u8;
-#[cfg(stage0)]
-pub type uv_udp_recv_cb = *u8;
-#[cfg(stage0)]
-pub type uv_close_cb = *u8;
-#[cfg(stage0)]
-pub type uv_walk_cb = *u8;
-#[cfg(stage0)]
-pub type uv_async_cb = *u8;
-#[cfg(stage0)]
-pub type uv_connect_cb = *u8;
-#[cfg(stage0)]
-pub type uv_connection_cb = *u8;
-#[cfg(stage0)]
-pub type uv_timer_cb = *u8;
-#[cfg(stage0)]
-pub type uv_write_cb = *u8;
-#[cfg(stage0)]
-pub type uv_getaddrinfo_cb = *u8;
-
-#[cfg(not(stage0))]
 pub type uv_idle_cb = extern "C" fn(handle: *uv_idle_t,
                                     status: c_int);
-#[cfg(not(stage0))]
 pub type uv_alloc_cb = extern "C" fn(stream: *uv_stream_t,
                                      suggested_size: size_t) -> uv_buf_t;
-#[cfg(not(stage0))]
 pub type uv_read_cb = extern "C" fn(stream: *uv_stream_t,
                                     nread: ssize_t,
                                     buf: uv_buf_t);
-#[cfg(not(stage0))]
 pub type uv_udp_send_cb = extern "C" fn(req: *uv_udp_send_t,
                                         status: c_int);
-#[cfg(not(stage0))]
 pub type uv_udp_recv_cb = extern "C" fn(handle: *uv_udp_t,
                                         nread: ssize_t,
                                         buf: uv_buf_t,
                                         addr: *sockaddr,
                                         flags: c_uint);
-#[cfg(not(stage0))]
 pub type uv_close_cb = extern "C" fn(handle: *uv_handle_t);
-#[cfg(not(stage0))]
 pub type uv_walk_cb = extern "C" fn(handle: *uv_handle_t,
                                     arg: *c_void);
-#[cfg(not(stage0))]
 pub type uv_async_cb = extern "C" fn(handle: *uv_async_t,
                                      status: c_int);
-#[cfg(not(stage0))]
 pub type uv_connect_cb = extern "C" fn(handle: *uv_connect_t,
                                        status: c_int);
-#[cfg(not(stage0))]
 pub type uv_connection_cb = extern "C" fn(handle: *uv_connection_t,
                                           status: c_int);
-#[cfg(not(stage0))]
 pub type uv_timer_cb = extern "C" fn(handle: *uv_timer_t,
                                      status: c_int);
-#[cfg(not(stage0))]
 pub type uv_write_cb = extern "C" fn(handle: *uv_write_t,
                                      status: c_int);
-#[cfg(not(stage0))]
 pub type uv_getaddrinfo_cb = extern "C" fn(req: *uv_getaddrinfo_t,
                                            status: c_int,
                                            res: *addrinfo);
diff --git a/src/libstd/run.rs b/src/libstd/run.rs
index 83646dc59b3..7fdee0a7be6 100644
--- a/src/libstd/run.rs
+++ b/src/libstd/run.rs
@@ -736,8 +736,6 @@ fn with_envp<T>(env: Option<~[(~str, ~str)]>, cb: &fn(*c_void) -> T) -> T {
             let mut tmps = vec::with_capacity(env.len());
 
             for pair in env.iter() {
-                // Use of match here is just to workaround limitations
-                // in the stage0 irrefutable pattern impl.
                 let kv = fmt!("%s=%s", pair.first(), pair.second());
                 tmps.push(kv.to_c_str());
             }
diff --git a/src/libstd/std.rs b/src/libstd/std.rs
index 05433c47059..e9d5dd416ad 100644
--- a/src/libstd/std.rs
+++ b/src/libstd/std.rs
@@ -179,14 +179,8 @@ pub mod run;
 pub mod sys;
 pub mod cast;
 pub mod fmt;
-#[cfg(stage0)] #[path = "repr_stage0.rs"]
-pub mod repr;
-#[cfg(not(stage0))]
 pub mod repr;
 pub mod cleanup;
-#[cfg(stage0)] #[path = "reflect_stage0.rs"]
-pub mod reflect;
-#[cfg(not(stage0))]
 pub mod reflect;
 pub mod condition;
 pub mod logging;
diff --git a/src/libstd/sys.rs b/src/libstd/sys.rs
index 3d35de0f898..c315c3f9dfc 100644
--- a/src/libstd/sys.rs
+++ b/src/libstd/sys.rs
@@ -14,8 +14,6 @@
 
 use c_str::ToCStr;
 use cast;
-#[cfg(stage0)]
-use io;
 use libc;
 use libc::{c_char, size_t};
 use repr;
@@ -92,7 +90,6 @@ pub fn refcount<T>(t: @T) -> uint {
     }
 }
 
-#[cfg(not(stage0))]
 pub fn log_str<T>(t: &T) -> ~str {
     use rt::io;
     use rt::io::Decorator;
@@ -101,12 +98,6 @@ pub fn log_str<T>(t: &T) -> ~str {
     repr::write_repr(&mut result as &mut io::Writer, t);
     str::from_utf8_owned(result.inner())
 }
-#[cfg(stage0)]
-pub fn log_str<T>(t: &T) -> ~str {
-    do io::with_str_writer |w| {
-        repr::write_repr(w, t)
-    }
-}
 
 /// Trait for initiating task failure.
 pub trait FailWithCause {
diff --git a/src/libstd/unstable/intrinsics.rs b/src/libstd/unstable/intrinsics.rs
index c3791d18b38..349739a5ea6 100644
--- a/src/libstd/unstable/intrinsics.rs
+++ b/src/libstd/unstable/intrinsics.rs
@@ -76,103 +76,7 @@ pub struct TyDesc {
 pub enum Opaque { }
 
 #[lang="ty_visitor"]
-#[cfg(not(test), stage0)]
-pub trait TyVisitor {
-    fn visit_bot(&self) -> bool;
-    fn visit_nil(&self) -> bool;
-    fn visit_bool(&self) -> bool;
-
-    fn visit_int(&self) -> bool;
-    fn visit_i8(&self) -> bool;
-    fn visit_i16(&self) -> bool;
-    fn visit_i32(&self) -> bool;
-    fn visit_i64(&self) -> bool;
-
-    fn visit_uint(&self) -> bool;
-    fn visit_u8(&self) -> bool;
-    fn visit_u16(&self) -> bool;
-    fn visit_u32(&self) -> bool;
-    fn visit_u64(&self) -> bool;
-
-    fn visit_float(&self) -> bool;
-    fn visit_f32(&self) -> bool;
-    fn visit_f64(&self) -> bool;
-
-    fn visit_char(&self) -> bool;
-
-    fn visit_estr_box(&self) -> bool;
-    fn visit_estr_uniq(&self) -> bool;
-    fn visit_estr_slice(&self) -> bool;
-    fn visit_estr_fixed(&self, n: uint, sz: uint, align: uint) -> bool;
-
-    fn visit_box(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_uniq(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_uniq_managed(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_ptr(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_rptr(&self, mtbl: uint, inner: *TyDesc) -> bool;
-
-    fn visit_vec(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_unboxed_vec(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_evec_box(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_evec_uniq(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_evec_uniq_managed(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_evec_slice(&self, mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_evec_fixed(&self, n: uint, sz: uint, align: uint,
-                        mtbl: uint, inner: *TyDesc) -> bool;
-
-    fn visit_enter_rec(&self, n_fields: uint,
-                       sz: uint, align: uint) -> bool;
-    fn visit_rec_field(&self, i: uint, name: &str,
-                       mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_leave_rec(&self, n_fields: uint,
-                       sz: uint, align: uint) -> bool;
-
-    fn visit_enter_class(&self, n_fields: uint,
-                         sz: uint, align: uint) -> bool;
-    fn visit_class_field(&self, i: uint, name: &str,
-                         mtbl: uint, inner: *TyDesc) -> bool;
-    fn visit_leave_class(&self, n_fields: uint,
-                         sz: uint, align: uint) -> bool;
-
-    fn visit_enter_tup(&self, n_fields: uint,
-                       sz: uint, align: uint) -> bool;
-    fn visit_tup_field(&self, i: uint, inner: *TyDesc) -> bool;
-    fn visit_leave_tup(&self, n_fields: uint,
-                       sz: uint, align: uint) -> bool;
-
-    fn visit_enter_enum(&self, n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> int,
-                        sz: uint, align: uint) -> bool;
-    fn visit_enter_enum_variant(&self, variant: uint,
-                                disr_val: int,
-                                n_fields: uint,
-                                name: &str) -> bool;
-    fn visit_enum_variant_field(&self, i: uint, offset: uint, inner: *TyDesc) -> bool;
-    fn visit_leave_enum_variant(&self, variant: uint,
-                                disr_val: int,
-                                n_fields: uint,
-                                name: &str) -> bool;
-    fn visit_leave_enum(&self, n_variants: uint,
-                        get_disr: extern unsafe fn(ptr: *Opaque) -> int,
-                        sz: uint, align: uint) -> bool;
-
-    fn visit_enter_fn(&self, purity: uint, proto: uint,
-                      n_inputs: uint, retstyle: uint) -> bool;
-    fn visit_fn_input(&self, i: uint, mode: uint, inner: *TyDesc) -> bool;
-    fn visit_fn_output(&self, retstyle: uint, inner: *TyDesc) -> bool;
-    fn visit_leave_fn(&self, purity: uint, proto: uint,
-                      n_inputs: uint, retstyle: uint) -> bool;
-
-    fn visit_trait(&self) -> bool;
-    fn visit_param(&self, i: uint) -> bool;
-    fn visit_self(&self) -> bool;
-    fn visit_type(&self) -> bool;
-    fn visit_opaque_box(&self) -> bool;
-    fn visit_closure_ptr(&self, ck: uint) -> bool;
-}
-
-#[lang="ty_visitor"]
-#[cfg(not(test), not(stage0))]
+#[cfg(not(test))]
 pub trait TyVisitor {
     fn visit_bot(&mut self) -> bool;
     fn visit_nil(&mut self) -> bool;
@@ -424,9 +328,6 @@ extern "rust-intrinsic" {
     /// Returns `true` if a type is managed (will be allocated on the local heap)
     pub fn contains_managed<T>() -> bool;
 
-    #[cfg(stage0)]
-    pub fn visit_tydesc(td: *TyDesc, tv: &TyVisitor);
-    #[cfg(not(stage0))]
     pub fn visit_tydesc(td: *TyDesc, tv: &mut TyVisitor);
 
     pub fn frame_address(f: &once fn(*u8));
diff --git a/src/libstd/unstable/sync.rs b/src/libstd/unstable/sync.rs
index 1dafeb27a0e..c2ef2300fc2 100644
--- a/src/libstd/unstable/sync.rs
+++ b/src/libstd/unstable/sync.rs
@@ -411,23 +411,6 @@ impl<T:Send> Exclusive<T> {
     }
 }
 
-#[cfg(stage0)]
-mod macro_hack {
-#[macro_escape];
-macro_rules! externfn(
-    (fn $name:ident () $(-> $ret_ty:ty),*) => (
-        extern {
-            fn $name() $(-> $ret_ty),*;
-        }
-    );
-    (fn $name:ident ($($arg_name:ident : $arg_ty:ty),*) $(-> $ret_ty:ty),*) => (
-        extern {
-            fn $name($($arg_name : $arg_ty),*) $(-> $ret_ty),*;
-        }
-    )
-)
-}
-
 externfn!(fn rust_create_little_lock() -> rust_little_lock)
 externfn!(fn rust_destroy_little_lock(lock: rust_little_lock))
 externfn!(fn rust_lock_little_lock(lock: rust_little_lock))