]> git.lizzy.rs Git - rust.git/commitdiff
Register new snapshots
authorAlex Crichton <alex@alexcrichton.com>
Tue, 30 Dec 2014 03:40:57 +0000 (19:40 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 30 Dec 2014 23:04:43 +0000 (15:04 -0800)
20 files changed:
src/libcollections/string.rs
src/libcore/fmt/float.rs
src/libcore/fmt/mod.rs
src/libcore/macros.rs
src/libcore/ops.rs
src/libcore/panicking.rs
src/liblog/lib.rs
src/liblog/macros.rs
src/libstd/bitflags.rs
src/libstd/fmt.rs
src/libstd/io/mod.rs
src/libstd/io/stdio.rs
src/libstd/macros.rs
src/libstd/rt/macros.rs
src/libstd/rt/unwind.rs
src/libstd/rt/util.rs
src/libstd/thread_local/mod.rs
src/libstd/time/duration.rs
src/libtime/lib.rs
src/snapshots.txt

index c6c19cae75f1efc1b55a005d0f6a8eeb6cf307d6..9fea4467db59a121bc48289edeb6c6c9f2579a73 100644 (file)
@@ -989,20 +989,11 @@ pub trait ToString {
 }
 
 impl<T: fmt::Show> ToString for T {
-    // NOTE(stage0): Remove cfg after a snapshot
-    #[cfg(not(stage0))]
     fn to_string(&self) -> String {
         let mut buf = Vec::<u8>::new();
         let _ = fmt::write(&mut buf, format_args!("{}", *self));
         String::from_utf8(buf).unwrap()
     }
-    // NOTE(stage0): Remove method after a snapshot
-    #[cfg(stage0)]
-    fn to_string(&self) -> String {
-        let mut buf = Vec::<u8>::new();
-        let _ = format_args!(|args| fmt::write(&mut buf, args), "{}", self);
-        String::from_utf8(buf).unwrap()
-    }
 }
 
 impl IntoCow<'static, String, str> for String {
index 329fe7c7b4913bc63a52115acc980cc61c0a0107..3787ae33fdaad39d448e241bbf2f39aa87e104be 100644 (file)
@@ -325,18 +325,9 @@ fn write(&mut self, bytes: &[u8]) -> fmt::Result {
 
             let mut filler = Filler { buf: &mut buf, end: &mut end };
             match sign {
-                // NOTE(stage0): Remove cfg after a snapshot
-                #[cfg(not(stage0))]
                 SignNeg => {
                     let _ = fmt::write(&mut filler, format_args!("{:-}", exp));
                 }
-                // NOTE(stage0): Remove match arm after a snapshot
-                #[cfg(stage0)]
-                SignNeg => {
-                    let _ = format_args!(|args| {
-                        fmt::write(&mut filler, args)
-                    }, "{:-}", exp);
-                }
             }
         }
     }
index b050b98de2f81ac60f193416c4b0485a055f4acc..9d275c9da9cb377c3e986a5371bd5ee80201c437 100644 (file)
@@ -70,21 +70,11 @@ pub trait FormatWriter {
     /// This function will return an instance of `FormatError` on error.
     fn write(&mut self, bytes: &[u8]) -> Result;
 
-    // NOTE(stage0): Remove cfg after a snapshot
-    #[cfg(not(stage0))]
     /// Glue for usage of the `write!` macro with implementers of this trait.
     ///
     /// This method should generally not be invoked manually, but rather through
     /// the `write!` macro itself.
     fn write_fmt(&mut self, args: Arguments) -> Result { write(self, args) }
-
-    // NOTE(stage0): Remove method after a snapshot
-    #[cfg(stage0)]
-    /// Glue for usage of the `write!` macro with implementers of this trait.
-    ///
-    /// This method should generally not be invoked manually, but rather through
-    /// the `write!` macro itself.
-    fn write_fmt(&mut self, args: &Arguments) -> Result { write(self, args) }
 }
 
 /// A struct to represent both where to emit formatting strings to and how they
@@ -204,17 +194,9 @@ pub struct Arguments<'a> {
 }
 
 impl<'a> Show for Arguments<'a> {
-    // NOTE(stage0): Remove cfg after a snapshot
-    #[cfg(not(stage0))]
     fn fmt(&self, fmt: &mut Formatter) -> Result {
         write(fmt.buf, *self)
     }
-
-    // NOTE(stage0): Remove method after a snapshot
-    #[cfg(stage0)]
-    fn fmt(&self, fmt: &mut Formatter) -> Result {
-        write(fmt.buf, self)
-    }
 }
 
 /// When a format is not otherwise specified, types are formatted by ascribing
@@ -287,8 +269,6 @@ pub trait UpperExp for Sized? {
     }
 };
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// The `write` function takes an output stream, a precompiled format string,
 /// and a list of arguments. The arguments will be formatted according to the
 /// specified format string into the output stream provided.
@@ -342,61 +322,6 @@ pub fn write(output: &mut FormatWriter, args: Arguments) -> Result {
     Ok(())
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-/// The `write` function takes an output stream, a precompiled format string,
-/// and a list of arguments. The arguments will be formatted according to the
-/// specified format string into the output stream provided.
-///
-/// # Arguments
-///
-///   * output - the buffer to write output to
-///   * args - the precompiled arguments generated by `format_args!`
-#[experimental = "libcore and I/O have yet to be reconciled, and this is an \
-                  implementation detail which should not otherwise be exported"]
-pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
-    let mut formatter = Formatter {
-        flags: 0,
-        width: None,
-        precision: None,
-        buf: output,
-        align: rt::AlignUnknown,
-        fill: ' ',
-        args: args.args,
-        curarg: args.args.iter(),
-    };
-
-    let mut pieces = args.pieces.iter();
-
-    match args.fmt {
-        None => {
-            // We can use default formatting parameters for all arguments.
-            for _ in range(0, args.args.len()) {
-                try!(formatter.buf.write(pieces.next().unwrap().as_bytes()));
-                try!(formatter.run(&DEFAULT_ARGUMENT));
-            }
-        }
-        Some(fmt) => {
-            // Every spec has a corresponding argument that is preceded by
-            // a string piece.
-            for (arg, piece) in fmt.iter().zip(pieces.by_ref()) {
-                try!(formatter.buf.write(piece.as_bytes()));
-                try!(formatter.run(arg));
-            }
-        }
-    }
-
-    // There can be only one trailing string piece left.
-    match pieces.next() {
-        Some(piece) => {
-            try!(formatter.buf.write(piece.as_bytes()));
-        }
-        None => {}
-    }
-
-    Ok(())
-}
-
 impl<'a> Formatter<'a> {
 
     // First up is the collection of functions used to execute a format string
@@ -603,22 +528,12 @@ pub fn write(&mut self, data: &[u8]) -> Result {
         self.buf.write(data)
     }
 
-    // NOTE(stage0): Remove cfg after a snapshot
-    #[cfg(not(stage0))]
     /// Writes some formatted information into this instance
     #[unstable = "reconciling core and I/O may alter this definition"]
     pub fn write_fmt(&mut self, fmt: Arguments) -> Result {
         write(self.buf, fmt)
     }
 
-    // NOTE(stage0): Remove method after a snapshot
-    #[cfg(stage0)]
-    /// Writes some formatted information into this instance
-    #[unstable = "reconciling core and I/O may alter this definition"]
-    pub fn write_fmt(&mut self, fmt: &Arguments) -> Result {
-        write(self.buf, fmt)
-    }
-
     /// Flags for formatting (packed version of rt::Flag)
     #[experimental = "return type may change and method was just created"]
     pub fn flags(&self) -> uint { self.flags }
index 781dbb0e55a3f8a99b61d8d084a4b5ab4ef1575b..e8fbd9d930f3388c8c4b3622cc2bad7affc865ca 100644 (file)
@@ -10,8 +10,6 @@
 
 #![macro_escape]
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// Entry point of task panic, for details, see std::macros
 #[macro_export]
 macro_rules! panic {
@@ -32,44 +30,6 @@ macro_rules! panic {
     });
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-/// Entry point of task panic, for details, see std::macros
-#[macro_export]
-macro_rules! panic {
-    () => (
-        panic!("{}", "explicit panic")
-    );
-    ($msg:expr) => ({
-        static _MSG_FILE_LINE: (&'static str, &'static str, uint) = ($msg, file!(), line!());
-        ::core::panicking::panic(&_MSG_FILE_LINE)
-    });
-    ($fmt:expr, $($arg:tt)*) => ({
-        // a closure can't have return type !, so we need a full
-        // function to pass to format_args!, *and* we need the
-        // file and line numbers right here; so an inner bare fn
-        // is our only choice.
-        //
-        // LLVM doesn't tend to inline this, presumably because begin_unwind_fmt
-        // is #[cold] and #[inline(never)] and because this is flagged as cold
-        // as returning !. We really do want this to be inlined, however,
-        // because it's just a tiny wrapper. Small wins (156K to 149K in size)
-        // were seen when forcing this to be inlined, and that number just goes
-        // up with the number of calls to panic!()
-        //
-        // The leading _'s are to avoid dead code warnings if this is
-        // used inside a dead function. Just `#[allow(dead_code)]` is
-        // insufficient, since the user may have
-        // `#[forbid(dead_code)]` and which cannot be overridden.
-        #[inline(always)]
-        fn _run_fmt(fmt: &::std::fmt::Arguments) -> ! {
-            static _FILE_LINE: (&'static str, uint) = (file!(), line!());
-            ::core::panicking::panic_fmt(fmt, &_FILE_LINE)
-        }
-        format_args!(_run_fmt, $fmt, $($arg)*)
-    });
-}
-
 /// Runtime assertion, for details see std::macros
 #[macro_export]
 macro_rules! assert {
@@ -119,25 +79,12 @@ macro_rules! try {
     ($e:expr) => (match $e { Ok(e) => e, Err(e) => return Err(e) })
 }
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// Writing a formatted string into a writer
 #[macro_export]
 macro_rules! write {
     ($dst:expr, $($arg:tt)*) => ((&mut *$dst).write_fmt(format_args!($($arg)*)))
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-/// Writing a formatted string into a writer
-#[macro_export]
-macro_rules! write {
-    ($dst:expr, $($arg:tt)*) => ({
-        let dst = &mut *$dst;
-        format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
-    })
-}
-
 /// Writing a formatted string plus a newline into a writer
 #[macro_export]
 macro_rules! writeln {
index f6b79ccc42b01d3592031a3fed57571947f5470b..af07869e95feb291c707b46634adfc97b33469ed 100644 (file)
@@ -292,58 +292,6 @@ fn rem(self, other: $t) -> $t {
 rem_float_impl! { f32, fmodf }
 rem_float_impl! { f64, fmod }
 
-/// The `Neg` trait is used to specify the functionality of unary `-`.
-///
-/// # Example
-///
-/// A trivial implementation of `Neg`. When `-Foo` happens, it ends up calling
-/// `neg`, and therefore, `main` prints `Negating!`.
-///
-/// ```
-/// #[deriving(Copy)]
-/// struct Foo;
-///
-/// impl Neg<Foo> for Foo {
-///     fn neg(&self) -> Foo {
-///         println!("Negating!");
-///         *self
-///     }
-/// }
-///
-/// fn main() {
-///     -Foo;
-/// }
-/// ```
-// NOTE(stage0): Remove trait after a snapshot
-#[cfg(stage0)]
-#[lang="neg"]
-pub trait Neg<Result> for Sized? {
-    /// The method for the unary `-` operator
-    fn neg(&self) -> Result;
-}
-
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-macro_rules! neg_impl {
-    ($($t:ty)*) => ($(
-        impl Neg<$t> for $t {
-            #[inline]
-            fn neg(&self) -> $t { -*self }
-        }
-    )*)
-}
-
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-macro_rules! neg_uint_impl {
-    ($t:ty, $t_signed:ty) => {
-        impl Neg<$t> for $t {
-            #[inline]
-            fn neg(&self) -> $t { -(*self as $t_signed) as $t }
-        }
-    }
-}
-
 /// The `Neg` trait is used to specify the functionality of unary `-`.
 ///
 /// # Example
@@ -367,14 +315,12 @@ fn neg(&self) -> $t { -(*self as $t_signed) as $t }
 ///     -Foo;
 /// }
 /// ```
-#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
 #[lang="neg"]
 pub trait Neg<Result> {
     /// The method for the unary `-` operator
     fn neg(self) -> Result;
 }
 
-#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
 macro_rules! neg_impl {
     ($($t:ty)*) => ($(
         impl Neg<$t> for $t {
@@ -384,7 +330,6 @@ fn neg(self) -> $t { -self }
     )*)
 }
 
-#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
 macro_rules! neg_uint_impl {
     ($t:ty, $t_signed:ty) => {
         impl Neg<$t> for $t {
@@ -403,48 +348,6 @@ fn neg(self) -> $t { -(self as $t_signed) as $t }
 neg_uint_impl! { u64, i64 }
 
 
-/// The `Not` trait is used to specify the functionality of unary `!`.
-///
-/// # Example
-///
-/// A trivial implementation of `Not`. When `!Foo` happens, it ends up calling
-/// `not`, and therefore, `main` prints `Not-ing!`.
-///
-/// ```
-/// #[deriving(Copy)]
-/// struct Foo;
-///
-/// impl Not<Foo> for Foo {
-///     fn not(&self) -> Foo {
-///         println!("Not-ing!");
-///         *self
-///     }
-/// }
-///
-/// fn main() {
-///     !Foo;
-/// }
-/// ```
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-#[lang="not"]
-pub trait Not<Result> for Sized? {
-    /// The method for the unary `!` operator
-    fn not(&self) -> Result;
-}
-
-
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-macro_rules! not_impl {
-    ($($t:ty)*) => ($(
-        impl Not<$t> for $t {
-            #[inline]
-            fn not(&self) -> $t { !*self }
-        }
-    )*)
-}
-
 /// The `Not` trait is used to specify the functionality of unary `!`.
 ///
 /// # Example
@@ -468,14 +371,12 @@ fn not(&self) -> $t { !*self }
 ///     !Foo;
 /// }
 /// ```
-#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
 #[lang="not"]
 pub trait Not<Result> {
     /// The method for the unary `!` operator
     fn not(self) -> Result;
 }
 
-#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
 macro_rules! not_impl {
     ($($t:ty)*) => ($(
         impl Not<$t> for $t {
index 32f09a4c17f3c64a15e768d48284f0fdba1861c3..61b4284e1dd9c08aa617571da9e4d08356846ed0 100644 (file)
 #![allow(dead_code, missing_docs)]
 
 use fmt;
-// NOTE(stage0): Remove import after a snapshot
-#[cfg(stage0)] use intrinsics;
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 #[cold] #[inline(never)] // this is the slow path, always
 #[lang="panic"]
 pub fn panic(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
@@ -43,22 +39,6 @@ pub fn panic(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
     panic_fmt(format_args!("{}", expr), &(file, line))
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-#[cold] #[inline(never)] // this is the slow path, always
-#[lang="panic"]
-pub fn panic(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
-    let (expr, file, line) = *expr_file_line;
-    let ref file_line = (file, line);
-    format_args!(|args| -> () {
-        panic_fmt(args, file_line);
-    }, "{}", expr);
-
-    unsafe { intrinsics::abort() }
-}
-
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 #[cold] #[inline(never)]
 #[lang="panic_bounds_check"]
 fn panic_bounds_check(file_line: &(&'static str, uint),
@@ -67,20 +47,6 @@ fn panic_bounds_check(file_line: &(&'static str, uint),
                            len, index), file_line)
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-#[cold] #[inline(never)]
-#[lang="panic_bounds_check"]
-fn panic_bounds_check(file_line: &(&'static str, uint),
-                     index: uint, len: uint) -> ! {
-    format_args!(|args| -> () {
-        panic_fmt(args, file_line);
-    }, "index out of bounds: the len is {} but the index is {}", len, index);
-    unsafe { intrinsics::abort() }
-}
-
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 #[cold] #[inline(never)]
 pub fn panic_fmt(fmt: fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
     #[allow(improper_ctypes)]
@@ -91,18 +57,3 @@ pub fn panic_fmt(fmt: fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
     let (file, line) = *file_line;
     unsafe { panic_impl(fmt, file, line) }
 }
-
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-#[cold] #[inline(never)]
-pub fn panic_fmt(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
-    #[allow(improper_ctypes)]
-    extern {
-        #[lang = "panic_fmt"]
-        fn panic_impl(fmt: &fmt::Arguments, file: &'static str,
-                        line: uint) -> !;
-
-    }
-    let (file, line) = *file_line;
-    unsafe { panic_impl(fmt, file, line) }
-}
index 1d865868f18834f75196366becf74a4a9bdbdec1..b30938ae7f57770e1ca517e52a6314052c250ce5 100644 (file)
@@ -268,8 +268,6 @@ fn drop(&mut self) {
     }
 }
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// This function is called directly by the compiler when using the logging
 /// macros. This function does not take into account whether the log level
 /// specified is active or not, it will always log something if this method is
@@ -304,42 +302,6 @@ pub fn log(level: u32, loc: &'static LogLocation, args: fmt::Arguments) {
     set_logger(logger);
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-/// This function is called directly by the compiler when using the logging
-/// macros. This function does not take into account whether the log level
-/// specified is active or not, it will always log something if this method is
-/// called.
-///
-/// It is not recommended to call this function directly, rather it should be
-/// invoked through the logging family of macros.
-#[doc(hidden)]
-pub fn log(level: u32, loc: &'static LogLocation, args: &fmt::Arguments) {
-    // Test the literal string from args against the current filter, if there
-    // is one.
-    match unsafe { FILTER.as_ref() } {
-        Some(filter) if !filter.is_match(args.to_string().as_slice()) => return,
-        _ => {}
-    }
-
-    // Completely remove the local logger from TLS in case anyone attempts to
-    // frob the slot while we're doing the logging. This will destroy any logger
-    // set during logging.
-    let mut logger = LOCAL_LOGGER.with(|s| {
-        s.borrow_mut().take()
-    }).unwrap_or_else(|| {
-        box DefaultLogger { handle: io::stderr() } as Box<Logger + Send>
-    });
-    logger.log(&LogRecord {
-        level: LogLevel(level),
-        args: *args,
-        file: loc.file,
-        module_path: loc.module_path,
-        line: loc.line,
-    });
-    set_logger(logger);
-}
-
 /// Getter for the global log level. This is a function so that it can be called
 /// safely
 #[doc(hidden)]
index 2e8302cc10f9aa794bdc49594f5d6bcb47f37c00..233d1c049f4e5e2bcdc69327f0c014a2e4069b98 100644 (file)
@@ -12,8 +12,6 @@
 
 #![macro_escape]
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// The standard logging macro
 ///
 /// This macro will generically log over a provided level (of type u32) with a
@@ -67,61 +65,6 @@ macro_rules! log {
     })
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-/// The standard logging macro
-///
-/// This macro will generically log over a provided level (of type u32) with a
-/// format!-based argument list. See documentation in `std::fmt` for details on
-/// how to use the syntax.
-///
-/// # Example
-///
-/// ```
-/// #![feature(phase)]
-/// #[phase(plugin, link)] extern crate log;
-///
-/// fn main() {
-///     log!(log::WARN, "this is a warning {}", "message");
-///     log!(log::DEBUG, "this is a debug message");
-///     log!(6, "this is a custom logging level: {level}", level=6u);
-/// }
-/// ```
-///
-/// Assumes the binary is `main`:
-///
-/// ```{.bash}
-/// $ RUST_LOG=warn ./main
-/// WARN:main: this is a warning message
-/// ```
-///
-/// ```{.bash}
-/// $ RUST_LOG=debug ./main
-/// DEBUG:main: this is a debug message
-/// WARN:main: this is a warning message
-/// ```
-///
-/// ```{.bash}
-/// $ RUST_LOG=6 ./main
-/// DEBUG:main: this is a debug message
-/// WARN:main: this is a warning message
-/// 6:main: this is a custom logging level: 6
-/// ```
-#[macro_export]
-macro_rules! log {
-    ($lvl:expr, $($arg:tt)+) => ({
-        static LOC: ::log::LogLocation = ::log::LogLocation {
-            line: line!(),
-            file: file!(),
-            module_path: module_path!(),
-        };
-        let lvl = $lvl;
-        if log_enabled!(lvl) {
-            format_args!(|args| { ::log::log(lvl, &LOC, args) }, $($arg)+)
-        }
-    })
-}
-
 /// A convenience macro for logging at the error log level.
 ///
 /// # Example
index a46b8a9ad9024c0922f3796c08d58dc376ccc326..aeb4df402a2cff3ffa96169caac74a237dc00dee 100644 (file)
@@ -241,17 +241,6 @@ fn sub(self, other: $BitFlags) -> $BitFlags {
             }
         }
 
-        // NOTE(stage0): Remove impl after a snapshot
-        #[cfg(stage0)]
-        impl Not<$BitFlags> for $BitFlags {
-            /// Returns the complement of this set of flags.
-            #[inline]
-            fn not(&self) -> $BitFlags {
-                $BitFlags { bits: !self.bits } & $BitFlags::all()
-            }
-        }
-
-        #[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
         impl Not<$BitFlags> for $BitFlags {
             /// Returns the complement of this set of flags.
             #[inline]
index b75cf9a196b507e87e936df574879b92bae7f6ae..957dd54a037cf86376dd462d6996434e33c77791 100644 (file)
 #[doc(hidden)]
 pub use core::fmt::{argument, argumentuint};
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// The format function takes a precompiled format string and a list of
 /// arguments, to return the resulting formatted string.
 ///
@@ -431,31 +429,6 @@ pub fn format(args: Arguments) -> string::String {
     string::String::from_utf8(output).unwrap()
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-/// The format function takes a precompiled format string and a list of
-/// arguments, to return the resulting formatted string.
-///
-/// # Arguments
-///
-///   * args - a structure of arguments generated via the `format_args!` macro.
-///
-/// # Example
-///
-/// ```rust
-/// use std::fmt;
-///
-/// let s = format_args!(fmt::format, "Hello, {}!", "world");
-/// assert_eq!(s, "Hello, world!".to_string());
-/// ```
-#[experimental = "this is an implementation detail of format! and should not \
-                  be called directly"]
-pub fn format(args: &Arguments) -> string::String {
-    let mut output = Vec::new();
-    let _ = write!(&mut output as &mut Writer, "{}", args);
-    string::String::from_utf8(output).unwrap()
-}
-
 impl<'a> Writer for Formatter<'a> {
     fn write(&mut self, b: &[u8]) -> io::IoResult<()> {
         match (*self).write(b) {
index 7a25360e695e40575aa4ed1014a0ce031eb454b8..8d5b125bb081fc268f93ffc03854ddfbb083c078 100644 (file)
@@ -1017,8 +1017,6 @@ pub trait Writer {
     /// decide whether their stream needs to be buffered or not.
     fn flush(&mut self) -> IoResult<()> { Ok(()) }
 
-    // NOTE(stage0): Remove cfg after a snapshot
-    #[cfg(not(stage0))]
     /// Writes a formatted string into this writer, returning any error
     /// encountered.
     ///
@@ -1057,45 +1055,6 @@ fn write(&mut self, bytes: &[u8]) -> fmt::Result {
     }
 
 
-    // NOTE(stage0): Remove method after a snapshot
-    #[cfg(stage0)]
-    /// Writes a formatted string into this writer, returning any error
-    /// encountered.
-    ///
-    /// This method is primarily used to interface with the `format_args!`
-    /// macro, but it is rare that this should explicitly be called. The
-    /// `write!` macro should be favored to invoke this method instead.
-    ///
-    /// # Errors
-    ///
-    /// This function will return any I/O error reported while formatting.
-    fn write_fmt(&mut self, fmt: &fmt::Arguments) -> IoResult<()> {
-        // Create a shim which translates a Writer to a FormatWriter and saves
-        // off I/O errors. instead of discarding them
-        struct Adaptor<'a, T:'a> {
-            inner: &'a mut T,
-            error: IoResult<()>,
-        }
-
-        impl<'a, T: Writer> fmt::FormatWriter for Adaptor<'a, T> {
-            fn write(&mut self, bytes: &[u8]) -> fmt::Result {
-                match self.inner.write(bytes) {
-                    Ok(()) => Ok(()),
-                    Err(e) => {
-                        self.error = Err(e);
-                        Err(fmt::Error)
-                    }
-                }
-            }
-        }
-
-        let mut output = Adaptor { inner: self, error: Ok(()) };
-        match fmt::write(&mut output, fmt) {
-            Ok(()) => Ok(()),
-            Err(..) => output.error
-        }
-    }
-
     /// Write a rust string into this sink.
     ///
     /// The bytes written will be the UTF-8 encoded version of the input string.
index 6c8e4eea40fdc442b5f799b2ceb140e83eedd500..43d2e078035a6ef83c60982d836b7e17e261b8bd 100644 (file)
@@ -378,38 +378,18 @@ pub fn println(s: &str) {
     })
 }
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// Similar to `print`, but takes a `fmt::Arguments` structure to be compatible
 /// with the `format_args!` macro.
 pub fn print_args(fmt: fmt::Arguments) {
     with_task_stdout(|io| write!(io, "{}", fmt))
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-/// Similar to `print`, but takes a `fmt::Arguments` structure to be compatible
-/// with the `format_args!` macro.
-pub fn print_args(fmt: &fmt::Arguments) {
-    with_task_stdout(|io| write!(io, "{}", fmt))
-}
-
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// Similar to `println`, but takes a `fmt::Arguments` structure to be
 /// compatible with the `format_args!` macro.
 pub fn println_args(fmt: fmt::Arguments) {
     with_task_stdout(|io| writeln!(io, "{}", fmt))
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-/// Similar to `println`, but takes a `fmt::Arguments` structure to be
-/// compatible with the `format_args!` macro.
-pub fn println_args(fmt: &fmt::Arguments) {
-    with_task_stdout(|io| writeln!(io, "{}", fmt))
-}
-
 /// Representation of a reader of a standard input stream
 pub struct StdReader {
     inner: StdSource
index edb6218c5cc0beb25a9971fe0e491b607965d717..ebb64bc2f2d518a8081fe3b79ed1de3742ff9a17 100644 (file)
@@ -17,8 +17,6 @@
 #![experimental]
 #![macro_escape]
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// The entry point for panic of Rust tasks.
 ///
 /// This macro is used to inject panic into a Rust task, causing the task to
@@ -59,63 +57,6 @@ macro_rules! panic {
     });
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-/// The entry point for panic of Rust tasks.
-///
-/// This macro is used to inject panic into a Rust task, causing the task to
-/// unwind and panic entirely. Each task's panic can be reaped as the
-/// `Box<Any>` type, and the single-argument form of the `panic!` macro will be
-/// the value which is transmitted.
-///
-/// The multi-argument form of this macro panics with a string and has the
-/// `format!` syntax for building a string.
-///
-/// # Example
-///
-/// ```should_fail
-/// # #![allow(unreachable_code)]
-/// panic!();
-/// panic!("this is a terrible mistake!");
-/// panic!(4i); // panic with the value of 4 to be collected elsewhere
-/// panic!("this is a {} {message}", "fancy", message = "message");
-/// ```
-#[macro_export]
-macro_rules! panic {
-    () => ({
-        panic!("explicit panic")
-    });
-    ($msg:expr) => ({
-        // static requires less code at runtime, more constant data
-        static _FILE_LINE: (&'static str, uint) = (file!(), line!());
-        ::std::rt::begin_unwind($msg, &_FILE_LINE)
-    });
-    ($fmt:expr, $($arg:tt)*) => ({
-        // a closure can't have return type !, so we need a full
-        // function to pass to format_args!, *and* we need the
-        // file and line numbers right here; so an inner bare fn
-        // is our only choice.
-        //
-        // LLVM doesn't tend to inline this, presumably because begin_unwind_fmt
-        // is #[cold] and #[inline(never)] and because this is flagged as cold
-        // as returning !. We really do want this to be inlined, however,
-        // because it's just a tiny wrapper. Small wins (156K to 149K in size)
-        // were seen when forcing this to be inlined, and that number just goes
-        // up with the number of calls to panic!()
-        //
-        // The leading _'s are to avoid dead code warnings if this is
-        // used inside a dead function. Just `#[allow(dead_code)]` is
-        // insufficient, since the user may have
-        // `#[forbid(dead_code)]` and which cannot be overridden.
-        #[inline(always)]
-        fn _run_fmt(fmt: &::std::fmt::Arguments) -> ! {
-            static _FILE_LINE: (&'static str, uint) = (file!(), line!());
-            ::std::rt::begin_unwind_fmt(fmt, &_FILE_LINE)
-        }
-        format_args!(_run_fmt, $fmt, $($arg)*)
-    });
-}
-
 /// Ensure that a boolean expression is `true` at runtime.
 ///
 /// This will invoke the `panic!` macro if the provided expression cannot be
@@ -289,8 +230,6 @@ macro_rules! unimplemented {
     () => (panic!("not yet implemented"))
 }
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// Use the syntax described in `std::fmt` to create a value of type `String`.
 /// See `std::fmt` for more information.
 ///
@@ -307,28 +246,6 @@ macro_rules! format {
     ($($arg:tt)*) => (::std::fmt::format(format_args!($($arg)*)))
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-/// Use the syntax described in `std::fmt` to create a value of type `String`.
-/// See `std::fmt` for more information.
-///
-/// # Example
-///
-/// ```
-/// format!("test");
-/// format!("hello {}", "world!");
-/// format!("x = {}, y = {y}", 10i, y = 30i);
-/// ```
-#[macro_export]
-#[stable]
-macro_rules! format {
-    ($($arg:tt)*) => (
-        format_args!(::std::fmt::format, $($arg)*)
-    )
-}
-
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// Use the `format!` syntax to write data into a buffer of type `&mut Writer`.
 /// See `std::fmt` for more information.
 ///
@@ -347,29 +264,6 @@ macro_rules! write {
     ($dst:expr, $($arg:tt)*) => ((&mut *$dst).write_fmt(format_args!($($arg)*)))
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-/// Use the `format!` syntax to write data into a buffer of type `&mut Writer`.
-/// See `std::fmt` for more information.
-///
-/// # Example
-///
-/// ```
-/// # #![allow(unused_must_use)]
-///
-/// let mut w = Vec::new();
-/// write!(&mut w, "test");
-/// write!(&mut w, "formatted {}", "arguments");
-/// ```
-#[macro_export]
-#[stable]
-macro_rules! write {
-    ($dst:expr, $($arg:tt)*) => ({
-        let dst = &mut *$dst;
-        format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
-    })
-}
-
 /// Equivalent to the `write!` macro, except that a newline is appended after
 /// the message is written.
 #[macro_export]
@@ -380,8 +274,6 @@ macro_rules! writeln {
     )
 }
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// Equivalent to the `println!` macro except that a newline is not printed at
 /// the end of the message.
 #[macro_export]
@@ -390,18 +282,6 @@ macro_rules! print {
     ($($arg:tt)*) => (::std::io::stdio::print_args(format_args!($($arg)*)))
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-/// Equivalent to the `println!` macro except that a newline is not printed at
-/// the end of the message.
-#[macro_export]
-#[stable]
-macro_rules! print {
-    ($($arg:tt)*) => (format_args!(::std::io::stdio::print_args, $($arg)*))
-}
-
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// Macro for printing to a task's stdout handle.
 ///
 /// Each task can override its stdout handle via `std::io::stdio::set_stdout`.
@@ -420,26 +300,6 @@ macro_rules! println {
     ($($arg:tt)*) => (::std::io::stdio::println_args(format_args!($($arg)*)))
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-/// Macro for printing to a task's stdout handle.
-///
-/// Each task can override its stdout handle via `std::io::stdio::set_stdout`.
-/// The syntax of this macro is the same as that used for `format!`. For more
-/// information, see `std::fmt` and `std::io::stdio`.
-///
-/// # Example
-///
-/// ```
-/// println!("hello there!");
-/// println!("format {} arguments", "some");
-/// ```
-#[macro_export]
-#[stable]
-macro_rules! println {
-    ($($arg:tt)*) => (format_args!(::std::io::stdio::println_args, $($arg)*))
-}
-
 /// Helper macro for unwrapping `Result` values while returning early with an
 /// error if the value of the expression is `Err`. For more information, see
 /// `std::io`.
index 095a27203f9819e28397ddcec446f1b707ad4129..0f35500a04a737469e510e52e7e7212b1c56881c 100644 (file)
 
 #![macro_escape]
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 macro_rules! rterrln {
     ($fmt:expr $($arg:tt)*) => ( {
         ::rt::util::dumb_print(format_args!(concat!($fmt, "\n") $($arg)*))
     } )
 }
 
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-macro_rules! rterrln {
-    ($fmt:expr $($arg:tt)*) => ( {
-        format_args!(::rt::util::dumb_print, concat!($fmt, "\n") $($arg)*)
-    } )
-}
-
 // Some basic logging. Enabled by passing `--cfg rtdebug` to the libstd build.
 macro_rules! rtdebug {
     ($($arg:tt)*) => ( {
@@ -50,14 +40,6 @@ macro_rules! rtassert {
     } )
 }
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 macro_rules! rtabort {
     ($($arg:tt)*) => (::rt::util::abort(format_args!($($arg)*)))
 }
-
-// NOTE(stage0): Remove macro after a snapshot
-#[cfg(stage0)]
-macro_rules! rtabort {
-    ($($arg:tt)*) => (format_args!(::rt::util::abort, $($arg)*))
-}
index 9b57dcc9e18bfc941cb4657cf198738ff620097d..c273c52daccadbb5551cbea9a79d6955685271de 100644 (file)
@@ -477,8 +477,6 @@ extern "C" fn inner(
     }
 }
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 #[cfg(not(test))]
 /// Entry point of panic from the libcore crate.
 #[lang = "panic_fmt"]
@@ -487,18 +485,6 @@ extern "C" fn inner(
     begin_unwind_fmt(msg, &(file, line))
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-#[cfg(not(test))]
-/// Entry point of panic from the libcore crate.
-#[lang = "panic_fmt"]
-pub extern fn rust_begin_unwind(msg: &fmt::Arguments,
-                                file: &'static str, line: uint) -> ! {
-    begin_unwind_fmt(msg, &(file, line))
-}
-
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 /// The entry point for unwinding with a formatted message.
 ///
 /// This is designed to reduce the amount of code required at the call
@@ -530,39 +516,6 @@ fn write(&mut self, buf: &[u8]) -> fmt::Result {
     begin_unwind_inner(msg, file_line)
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-/// The entry point for unwinding with a formatted message.
-///
-/// This is designed to reduce the amount of code required at the call
-/// site as much as possible (so that `panic!()` has as low an impact
-/// on (e.g.) the inlining of other functions as possible), by moving
-/// the actual formatting into this shared place.
-#[inline(never)] #[cold]
-pub fn begin_unwind_fmt(msg: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
-    use fmt::FormatWriter;
-
-    // We do two allocations here, unfortunately. But (a) they're
-    // required with the current scheme, and (b) we don't handle
-    // panic + OOM properly anyway (see comment in begin_unwind
-    // below).
-
-    struct VecWriter<'a> { v: &'a mut Vec<u8> }
-
-    impl<'a> fmt::FormatWriter for VecWriter<'a> {
-        fn write(&mut self, buf: &[u8]) -> fmt::Result {
-            self.v.push_all(buf);
-            Ok(())
-        }
-    }
-
-    let mut v = Vec::new();
-    let _ = write!(&mut VecWriter { v: &mut v }, "{}", msg);
-
-    let msg = box String::from_utf8_lossy(v.as_slice()).into_owned();
-    begin_unwind_inner(msg, file_line)
-}
-
 /// This is the entry point of unwinding for panic!() and assert!().
 #[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible
 pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, uint)) -> ! {
index 6b007056a51141ac2ce4c9fae6bd1bf5227f2a5d..5448af3f753b33eeb7e415a99c181241e45e4be8 100644 (file)
@@ -112,25 +112,11 @@ fn write(&mut self, data: &[u8]) -> fmt::Result {
     }
 }
 
-// NOTE(stage0): Remove cfg after a snapshot
-#[cfg(not(stage0))]
 pub fn dumb_print(args: fmt::Arguments) {
     let _ = Stderr.write_fmt(args);
 }
 
-// NOTE(stage0): Remove function after a snapshot
-#[cfg(stage0)]
-pub fn dumb_print(args: &fmt::Arguments) {
-    let mut w = Stderr;
-    let _ = write!(&mut w, "{}", args);
-}
-
-// NOTE(stage0): Remove wrappers after a snapshot
-#[cfg(not(stage0))] pub fn abort(args: fmt::Arguments) -> ! { abort_(&args) }
-#[cfg(stage0)] pub fn abort(args: &fmt::Arguments) -> ! { abort_(args) }
-
-// NOTE(stage0): Change to `pub fn abort(args: fmt::Arguments) -> !` after a snapshot
-fn abort_(args: &fmt::Arguments) -> ! {
+pub fn abort(args: fmt::Arguments) -> ! {
     use fmt::FormatWriter;
 
     struct BufWriter<'a> {
index 4cfa27093527a81720182f5692377a642458baeb..14dd2a1ac9b587208c3426338331c8c498808f72 100644 (file)
@@ -189,22 +189,7 @@ macro_rules! __thread_local_inner {
             }
         };
 
-        #[cfg(all(stage0, not(any(target_os = "macos", target_os = "linux"))))]
-        const INIT: ::std::thread_local::KeyInner<$t> = {
-            unsafe extern fn __destroy(ptr: *mut u8) {
-                ::std::thread_local::destroy_value::<$t>(ptr);
-            }
-
-            ::std::thread_local::KeyInner {
-                inner: ::std::cell::UnsafeCell { value: $init },
-                os: ::std::thread_local::OsStaticKey {
-                    inner: ::std::thread_local::OS_INIT_INNER,
-                    dtor: ::std::option::Option::Some(__destroy),
-                },
-            }
-        };
-
-        #[cfg(all(not(stage0), not(any(target_os = "macos", target_os = "linux"))))]
+        #[cfg(all(not(any(target_os = "macos", target_os = "linux"))))]
         const INIT: ::std::thread_local::KeyInner<$t> = {
             unsafe extern fn __destroy(ptr: *mut u8) {
                 ::std::thread_local::destroy_value::<$t>(ptr);
@@ -346,16 +331,10 @@ unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
         // *should* be the case that this loop always terminates because we
         // provide the guarantee that a TLS key cannot be set after it is
         // flagged for destruction.
-        #[cfg(not(stage0))]
         static DTORS: os::StaticKey = os::StaticKey {
             inner: os::INIT_INNER,
             dtor: Some(run_dtors as unsafe extern "C" fn(*mut u8)),
         };
-        #[cfg(stage0)]
-        static DTORS: os::StaticKey = os::StaticKey {
-            inner: os::INIT_INNER,
-            dtor: Some(run_dtors),
-        };
         type List = Vec<(*mut u8, unsafe extern fn(*mut u8))>;
         if DTORS.get().is_null() {
             let v: Box<List> = box Vec::new();
index f7351c9580f2fbecfb35891fe46e1772eba3ea5a..51564b539768d81fd063cf23c6258b0ec77b35af 100644 (file)
@@ -262,20 +262,6 @@ pub fn is_zero(&self) -> bool {
     }
 }
 
-// NOTE(stage0): Remove impl after a snapshot
-#[cfg(stage0)]
-impl Neg<Duration> for Duration {
-    #[inline]
-    fn neg(&self) -> Duration {
-        if self.nanos == 0 {
-            Duration { secs: -self.secs, nanos: 0 }
-        } else {
-            Duration { secs: -self.secs - 1, nanos: NANOS_PER_SEC - self.nanos }
-        }
-    }
-}
-
-#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
 impl Neg<Duration> for Duration {
     #[inline]
     fn neg(self) -> Duration {
index e58a0229d69623fd1bce2f55e8720c437a0d2e18..930aa0270647c1d84e46d20d981b24faa345cf21 100644 (file)
@@ -24,8 +24,6 @@
 
 #[cfg(test)] #[phase(plugin, link)] extern crate log;
 
-#[cfg(stage0)]
-extern crate serialize;
 extern crate "serialize" as rustc_serialize;
 extern crate libc;
 
index c3cdf4acba15080d24f77fb04c6c943b7cfa6282..6a9bfa07cf77121c11d3c450b8f389afcabcbcee 100644 (file)
@@ -1,3 +1,12 @@
+S 2014-12-30 023dfb0
+  freebsd-x86_64 41ecd0ac557c823831c46696c7d78dc250398f25
+  linux-i386 fe6b59bf70a397e18629cb82264f7c6a70df34d4
+  linux-x86_64 8ab3a223f65fbf6b0aa80fcf0564a6d0fb9122e8
+  macos-i386 d23edb1be58b8683782a473cdc249c58a959c165
+  macos-x86_64 ab87616fa5d427978db3acd2d705042133ca3c09
+  winnt-i386 f2c26ac1ccb9d9a00886da9b504190681de89a5f
+  winnt-x86_64 fa2c7636bb15583ae387554b561ab09babee281a
+
 S 2014-12-20 8443b09
   freebsd-x86_64 004f54dce86faeebc15abf92c8742634b53987e6
   linux-i386 3daf531aed03f5769402f2fef852377e2838db98