Skip to content

Commit 262c1ef

Browse files
committed
Register new snapshots
1 parent 023dfb0 commit 262c1ef

File tree

20 files changed

+11
-756
lines changed

20 files changed

+11
-756
lines changed

src/libcollections/string.rs

-9
Original file line numberDiff line numberDiff line change
@@ -989,20 +989,11 @@ pub trait ToString {
989989
}
990990

991991
impl<T: fmt::Show> ToString for T {
992-
// NOTE(stage0): Remove cfg after a snapshot
993-
#[cfg(not(stage0))]
994992
fn to_string(&self) -> String {
995993
let mut buf = Vec::<u8>::new();
996994
let _ = fmt::write(&mut buf, format_args!("{}", *self));
997995
String::from_utf8(buf).unwrap()
998996
}
999-
// NOTE(stage0): Remove method after a snapshot
1000-
#[cfg(stage0)]
1001-
fn to_string(&self) -> String {
1002-
let mut buf = Vec::<u8>::new();
1003-
let _ = format_args!(|args| fmt::write(&mut buf, args), "{}", self);
1004-
String::from_utf8(buf).unwrap()
1005-
}
1006997
}
1007998

1008999
impl IntoCow<'static, String, str> for String {

src/libcore/fmt/float.rs

-9
Original file line numberDiff line numberDiff line change
@@ -325,18 +325,9 @@ pub fn float_to_str_bytes_common<T: Float, U, F>(
325325

326326
let mut filler = Filler { buf: &mut buf, end: &mut end };
327327
match sign {
328-
// NOTE(stage0): Remove cfg after a snapshot
329-
#[cfg(not(stage0))]
330328
SignNeg => {
331329
let _ = fmt::write(&mut filler, format_args!("{:-}", exp));
332330
}
333-
// NOTE(stage0): Remove match arm after a snapshot
334-
#[cfg(stage0)]
335-
SignNeg => {
336-
let _ = format_args!(|args| {
337-
fmt::write(&mut filler, args)
338-
}, "{:-}", exp);
339-
}
340331
}
341332
}
342333
}

src/libcore/fmt/mod.rs

-85
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,11 @@ pub trait FormatWriter {
7070
/// This function will return an instance of `FormatError` on error.
7171
fn write(&mut self, bytes: &[u8]) -> Result;
7272

73-
// NOTE(stage0): Remove cfg after a snapshot
74-
#[cfg(not(stage0))]
7573
/// Glue for usage of the `write!` macro with implementers of this trait.
7674
///
7775
/// This method should generally not be invoked manually, but rather through
7876
/// the `write!` macro itself.
7977
fn write_fmt(&mut self, args: Arguments) -> Result { write(self, args) }
80-
81-
// NOTE(stage0): Remove method after a snapshot
82-
#[cfg(stage0)]
83-
/// Glue for usage of the `write!` macro with implementers of this trait.
84-
///
85-
/// This method should generally not be invoked manually, but rather through
86-
/// the `write!` macro itself.
87-
fn write_fmt(&mut self, args: &Arguments) -> Result { write(self, args) }
8878
}
8979

9080
/// A struct to represent both where to emit formatting strings to and how they
@@ -204,17 +194,9 @@ pub struct Arguments<'a> {
204194
}
205195

206196
impl<'a> Show for Arguments<'a> {
207-
// NOTE(stage0): Remove cfg after a snapshot
208-
#[cfg(not(stage0))]
209197
fn fmt(&self, fmt: &mut Formatter) -> Result {
210198
write(fmt.buf, *self)
211199
}
212-
213-
// NOTE(stage0): Remove method after a snapshot
214-
#[cfg(stage0)]
215-
fn fmt(&self, fmt: &mut Formatter) -> Result {
216-
write(fmt.buf, self)
217-
}
218200
}
219201

220202
/// When a format is not otherwise specified, types are formatted by ascribing
@@ -287,8 +269,6 @@ static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
287269
}
288270
};
289271

290-
// NOTE(stage0): Remove cfg after a snapshot
291-
#[cfg(not(stage0))]
292272
/// The `write` function takes an output stream, a precompiled format string,
293273
/// and a list of arguments. The arguments will be formatted according to the
294274
/// specified format string into the output stream provided.
@@ -342,61 +322,6 @@ pub fn write(output: &mut FormatWriter, args: Arguments) -> Result {
342322
Ok(())
343323
}
344324

345-
// NOTE(stage0): Remove function after a snapshot
346-
#[cfg(stage0)]
347-
/// The `write` function takes an output stream, a precompiled format string,
348-
/// and a list of arguments. The arguments will be formatted according to the
349-
/// specified format string into the output stream provided.
350-
///
351-
/// # Arguments
352-
///
353-
/// * output - the buffer to write output to
354-
/// * args - the precompiled arguments generated by `format_args!`
355-
#[experimental = "libcore and I/O have yet to be reconciled, and this is an \
356-
implementation detail which should not otherwise be exported"]
357-
pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
358-
let mut formatter = Formatter {
359-
flags: 0,
360-
width: None,
361-
precision: None,
362-
buf: output,
363-
align: rt::AlignUnknown,
364-
fill: ' ',
365-
args: args.args,
366-
curarg: args.args.iter(),
367-
};
368-
369-
let mut pieces = args.pieces.iter();
370-
371-
match args.fmt {
372-
None => {
373-
// We can use default formatting parameters for all arguments.
374-
for _ in range(0, args.args.len()) {
375-
try!(formatter.buf.write(pieces.next().unwrap().as_bytes()));
376-
try!(formatter.run(&DEFAULT_ARGUMENT));
377-
}
378-
}
379-
Some(fmt) => {
380-
// Every spec has a corresponding argument that is preceded by
381-
// a string piece.
382-
for (arg, piece) in fmt.iter().zip(pieces.by_ref()) {
383-
try!(formatter.buf.write(piece.as_bytes()));
384-
try!(formatter.run(arg));
385-
}
386-
}
387-
}
388-
389-
// There can be only one trailing string piece left.
390-
match pieces.next() {
391-
Some(piece) => {
392-
try!(formatter.buf.write(piece.as_bytes()));
393-
}
394-
None => {}
395-
}
396-
397-
Ok(())
398-
}
399-
400325
impl<'a> Formatter<'a> {
401326

402327
// First up is the collection of functions used to execute a format string
@@ -603,22 +528,12 @@ impl<'a> Formatter<'a> {
603528
self.buf.write(data)
604529
}
605530

606-
// NOTE(stage0): Remove cfg after a snapshot
607-
#[cfg(not(stage0))]
608531
/// Writes some formatted information into this instance
609532
#[unstable = "reconciling core and I/O may alter this definition"]
610533
pub fn write_fmt(&mut self, fmt: Arguments) -> Result {
611534
write(self.buf, fmt)
612535
}
613536

614-
// NOTE(stage0): Remove method after a snapshot
615-
#[cfg(stage0)]
616-
/// Writes some formatted information into this instance
617-
#[unstable = "reconciling core and I/O may alter this definition"]
618-
pub fn write_fmt(&mut self, fmt: &Arguments) -> Result {
619-
write(self.buf, fmt)
620-
}
621-
622537
/// Flags for formatting (packed version of rt::Flag)
623538
#[experimental = "return type may change and method was just created"]
624539
pub fn flags(&self) -> uint { self.flags }

src/libcore/macros.rs

-53
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#![macro_escape]
1212

13-
// NOTE(stage0): Remove cfg after a snapshot
14-
#[cfg(not(stage0))]
1513
/// Entry point of task panic, for details, see std::macros
1614
#[macro_export]
1715
macro_rules! panic {
@@ -32,44 +30,6 @@ macro_rules! panic {
3230
});
3331
}
3432

35-
// NOTE(stage0): Remove macro after a snapshot
36-
#[cfg(stage0)]
37-
/// Entry point of task panic, for details, see std::macros
38-
#[macro_export]
39-
macro_rules! panic {
40-
() => (
41-
panic!("{}", "explicit panic")
42-
);
43-
($msg:expr) => ({
44-
static _MSG_FILE_LINE: (&'static str, &'static str, uint) = ($msg, file!(), line!());
45-
::core::panicking::panic(&_MSG_FILE_LINE)
46-
});
47-
($fmt:expr, $($arg:tt)*) => ({
48-
// a closure can't have return type !, so we need a full
49-
// function to pass to format_args!, *and* we need the
50-
// file and line numbers right here; so an inner bare fn
51-
// is our only choice.
52-
//
53-
// LLVM doesn't tend to inline this, presumably because begin_unwind_fmt
54-
// is #[cold] and #[inline(never)] and because this is flagged as cold
55-
// as returning !. We really do want this to be inlined, however,
56-
// because it's just a tiny wrapper. Small wins (156K to 149K in size)
57-
// were seen when forcing this to be inlined, and that number just goes
58-
// up with the number of calls to panic!()
59-
//
60-
// The leading _'s are to avoid dead code warnings if this is
61-
// used inside a dead function. Just `#[allow(dead_code)]` is
62-
// insufficient, since the user may have
63-
// `#[forbid(dead_code)]` and which cannot be overridden.
64-
#[inline(always)]
65-
fn _run_fmt(fmt: &::std::fmt::Arguments) -> ! {
66-
static _FILE_LINE: (&'static str, uint) = (file!(), line!());
67-
::core::panicking::panic_fmt(fmt, &_FILE_LINE)
68-
}
69-
format_args!(_run_fmt, $fmt, $($arg)*)
70-
});
71-
}
72-
7333
/// Runtime assertion, for details see std::macros
7434
#[macro_export]
7535
macro_rules! assert {
@@ -119,25 +79,12 @@ macro_rules! try {
11979
($e:expr) => (match $e { Ok(e) => e, Err(e) => return Err(e) })
12080
}
12181

122-
// NOTE(stage0): Remove cfg after a snapshot
123-
#[cfg(not(stage0))]
12482
/// Writing a formatted string into a writer
12583
#[macro_export]
12684
macro_rules! write {
12785
($dst:expr, $($arg:tt)*) => ((&mut *$dst).write_fmt(format_args!($($arg)*)))
12886
}
12987

130-
// NOTE(stage0): Remove macro after a snapshot
131-
#[cfg(stage0)]
132-
/// Writing a formatted string into a writer
133-
#[macro_export]
134-
macro_rules! write {
135-
($dst:expr, $($arg:tt)*) => ({
136-
let dst = &mut *$dst;
137-
format_args!(|args| { dst.write_fmt(args) }, $($arg)*)
138-
})
139-
}
140-
14188
/// Writing a formatted string plus a newline into a writer
14289
#[macro_export]
14390
macro_rules! writeln {

src/libcore/ops.rs

-99
Original file line numberDiff line numberDiff line change
@@ -292,58 +292,6 @@ rem_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 }
292292
rem_float_impl! { f32, fmodf }
293293
rem_float_impl! { f64, fmod }
294294

295-
/// The `Neg` trait is used to specify the functionality of unary `-`.
296-
///
297-
/// # Example
298-
///
299-
/// A trivial implementation of `Neg`. When `-Foo` happens, it ends up calling
300-
/// `neg`, and therefore, `main` prints `Negating!`.
301-
///
302-
/// ```
303-
/// #[deriving(Copy)]
304-
/// struct Foo;
305-
///
306-
/// impl Neg<Foo> for Foo {
307-
/// fn neg(&self) -> Foo {
308-
/// println!("Negating!");
309-
/// *self
310-
/// }
311-
/// }
312-
///
313-
/// fn main() {
314-
/// -Foo;
315-
/// }
316-
/// ```
317-
// NOTE(stage0): Remove trait after a snapshot
318-
#[cfg(stage0)]
319-
#[lang="neg"]
320-
pub trait Neg<Result> for Sized? {
321-
/// The method for the unary `-` operator
322-
fn neg(&self) -> Result;
323-
}
324-
325-
// NOTE(stage0): Remove macro after a snapshot
326-
#[cfg(stage0)]
327-
macro_rules! neg_impl {
328-
($($t:ty)*) => ($(
329-
impl Neg<$t> for $t {
330-
#[inline]
331-
fn neg(&self) -> $t { -*self }
332-
}
333-
)*)
334-
}
335-
336-
// NOTE(stage0): Remove macro after a snapshot
337-
#[cfg(stage0)]
338-
macro_rules! neg_uint_impl {
339-
($t:ty, $t_signed:ty) => {
340-
impl Neg<$t> for $t {
341-
#[inline]
342-
fn neg(&self) -> $t { -(*self as $t_signed) as $t }
343-
}
344-
}
345-
}
346-
347295
/// The `Neg` trait is used to specify the functionality of unary `-`.
348296
///
349297
/// # Example
@@ -367,14 +315,12 @@ macro_rules! neg_uint_impl {
367315
/// -Foo;
368316
/// }
369317
/// ```
370-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
371318
#[lang="neg"]
372319
pub trait Neg<Result> {
373320
/// The method for the unary `-` operator
374321
fn neg(self) -> Result;
375322
}
376323

377-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
378324
macro_rules! neg_impl {
379325
($($t:ty)*) => ($(
380326
impl Neg<$t> for $t {
@@ -384,7 +330,6 @@ macro_rules! neg_impl {
384330
)*)
385331
}
386332

387-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
388333
macro_rules! neg_uint_impl {
389334
($t:ty, $t_signed:ty) => {
390335
impl Neg<$t> for $t {
@@ -403,48 +348,6 @@ neg_uint_impl! { u32, i32 }
403348
neg_uint_impl! { u64, i64 }
404349

405350

406-
/// The `Not` trait is used to specify the functionality of unary `!`.
407-
///
408-
/// # Example
409-
///
410-
/// A trivial implementation of `Not`. When `!Foo` happens, it ends up calling
411-
/// `not`, and therefore, `main` prints `Not-ing!`.
412-
///
413-
/// ```
414-
/// #[deriving(Copy)]
415-
/// struct Foo;
416-
///
417-
/// impl Not<Foo> for Foo {
418-
/// fn not(&self) -> Foo {
419-
/// println!("Not-ing!");
420-
/// *self
421-
/// }
422-
/// }
423-
///
424-
/// fn main() {
425-
/// !Foo;
426-
/// }
427-
/// ```
428-
// NOTE(stage0): Remove macro after a snapshot
429-
#[cfg(stage0)]
430-
#[lang="not"]
431-
pub trait Not<Result> for Sized? {
432-
/// The method for the unary `!` operator
433-
fn not(&self) -> Result;
434-
}
435-
436-
437-
// NOTE(stage0): Remove macro after a snapshot
438-
#[cfg(stage0)]
439-
macro_rules! not_impl {
440-
($($t:ty)*) => ($(
441-
impl Not<$t> for $t {
442-
#[inline]
443-
fn not(&self) -> $t { !*self }
444-
}
445-
)*)
446-
}
447-
448351
/// The `Not` trait is used to specify the functionality of unary `!`.
449352
///
450353
/// # Example
@@ -468,14 +371,12 @@ macro_rules! not_impl {
468371
/// !Foo;
469372
/// }
470373
/// ```
471-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
472374
#[lang="not"]
473375
pub trait Not<Result> {
474376
/// The method for the unary `!` operator
475377
fn not(self) -> Result;
476378
}
477379

478-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
479380
macro_rules! not_impl {
480381
($($t:ty)*) => ($(
481382
impl Not<$t> for $t {

0 commit comments

Comments
 (0)