From b53e9f17d336bc3550ab2c5eda503bd9e719e94f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 7 Jan 2015 10:27:52 -0800 Subject: [PATCH 1/3] Register new snapshots --- src/libcollections/lib.rs | 2 - src/libcollections/string.rs | 12 -- src/libcollections/vec.rs | 9 -- src/libcore/borrow.rs | 12 +- src/libcore/fmt/mod.rs | 42 ------- src/libcore/fmt/num.rs | 16 --- src/libcore/lib.rs | 2 - src/liblibc/lib.rs | 2 - src/librand/lib.rs | 2 - src/libregex/re.rs | 9 -- src/librustc_back/svh.rs | 4 +- src/librustdoc/html/escape.rs | 8 -- src/librustdoc/html/format.rs | 193 ------------------------------- src/librustdoc/html/item_type.rs | 8 -- src/librustdoc/html/markdown.rs | 16 --- src/librustdoc/html/render.rs | 32 ----- src/libserialize/json.rs | 8 -- src/libserialize/lib.rs | 1 - src/libstd/io/mod.rs | 3 +- src/libstd/io/process.rs | 7 -- src/libstd/lib.rs | 4 - src/libstd/path/mod.rs | 1 - src/libsyntax/ast.rs | 4 - src/libsyntax/ast_map/mod.rs | 9 +- src/snapshots.txt | 9 ++ 25 files changed, 13 insertions(+), 402 deletions(-) diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 6eab36d8844..e7f48c291c9 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -101,8 +101,6 @@ mod std { pub use core::option; // necessary for panic!() pub use core::clone; // deriving(Clone) pub use core::cmp; // deriving(Eq, Ord, etc.) - #[cfg(stage0)] - pub use core::marker as kinds; pub use core::marker; // deriving(Copy) pub use core::hash; // deriving(Hash) } diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 59418f50e3c..507703c3a90 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -921,18 +921,6 @@ pub trait ToString { fn to_string(&self) -> String; } -#[cfg(stage0)] -impl ToString for T { - fn to_string(&self) -> String { - use core::fmt::Writer; - let mut buf = String::new(); - let _ = buf.write_fmt(format_args!("{}", self)); - buf.shrink_to_fit(); - buf - } -} - -#[cfg(not(stage0))] impl ToString for T { fn to_string(&self) -> String { use core::fmt::Writer; diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 5fc3fafac9e..312d739e3a4 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -1454,15 +1454,6 @@ impl fmt::Show for Vec { } } -#[cfg(stage0)] -#[experimental = "waiting on Show stability"] -impl fmt::String for Vec { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self.as_slice(), f) - } -} - -#[cfg(not(stage0))] #[experimental = "waiting on Show stability"] impl fmt::String for Vec { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/libcore/borrow.rs b/src/libcore/borrow.rs index 31631355422..484b816413b 100644 --- a/src/libcore/borrow.rs +++ b/src/libcore/borrow.rs @@ -133,7 +133,7 @@ impl ToOwned for T where T: Clone { /// } /// } /// ``` -//#[deriving(Show)] NOTE(stage0): uncomment after snapshot +#[derive(Show)] pub enum Cow<'a, T, B: ?Sized + 'a> where B: ToOwned { /// Borrowed data. Borrowed(&'a B), @@ -142,16 +142,6 @@ pub enum Cow<'a, T, B: ?Sized + 'a> where B: ToOwned { Owned(T) } -//NOTE(stage0): replace with deriving(Show) after snapshot -impl<'a, T, B: ?Sized> fmt::Show for Cow<'a, T, B> where - B: fmt::String + ToOwned, - T: fmt::String -{ - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - #[stable] impl<'a, T, B: ?Sized> Clone for Cow<'a, T, B> where B: ToOwned { fn clone(&self) -> Cow<'a, T, B> { diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index f9027f19068..cd6e9dafca3 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -633,16 +633,6 @@ impl String for bool { } } -#[cfg(stage0)] -//NOTE(stage0): remove impl after snapshot -impl Show for str { - fn fmt(&self, f: &mut Formatter) -> Result { - String::fmt(self, f) - } -} - -#[cfg(not(stage0))] -//NOTE(stage0): remove cfg after snapshot impl Show for str { fn fmt(&self, f: &mut Formatter) -> Result { try!(write!(f, "\"")); @@ -659,16 +649,6 @@ impl String for str { } } -#[cfg(stage0)] -//NOTE(stage0): remove impl after snapshot -impl Show for char { - fn fmt(&self, f: &mut Formatter) -> Result { - String::fmt(self, f) - } -} - -#[cfg(not(stage0))] -//NOTE(stage0): remove cfg after snapshot impl Show for char { fn fmt(&self, f: &mut Formatter) -> Result { use char::CharExt; @@ -863,28 +843,6 @@ impl Show for [T] { } } -#[cfg(stage0)] -impl String for [T] { - fn fmt(&self, f: &mut Formatter) -> Result { - if f.flags & (1 << (rt::FlagAlternate as uint)) == 0 { - try!(write!(f, "[")); - } - let mut is_first = true; - for x in self.iter() { - if is_first { - is_first = false; - } else { - try!(write!(f, ", ")); - } - try!(write!(f, "{}", *x)) - } - if f.flags & (1 << (rt::FlagAlternate as uint)) == 0 { - try!(write!(f, "]")); - } - Ok(()) - } -} -#[cfg(not(stage0))] impl String for [T] { fn fmt(&self, f: &mut Formatter) -> Result { if f.flags & (1 << (rt::FlagAlternate as uint)) == 0 { diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs index 17149aed3db..905001cd567 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -155,14 +155,6 @@ pub fn radix(x: T, base: u8) -> RadixFmt { macro_rules! radix_fmt { ($T:ty as $U:ty, $fmt:ident, $S:expr) => { - #[cfg(stage0)] - impl fmt::Show for RadixFmt<$T, Radix> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } - } - - #[cfg(not(stage0))] impl fmt::Show for RadixFmt<$T, Radix> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(fmt::String::fmt(self, f)); @@ -188,14 +180,6 @@ macro_rules! int_base { macro_rules! show { ($T:ident with $S:expr) => { - #[cfg(stage0)] - impl fmt::Show for $T { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } - } - - #[cfg(not(stage0))] impl fmt::Show for $T { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(fmt::String::fmt(self, f)); diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index a7e3b61b0d4..ea5d37810cc 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -146,8 +146,6 @@ mod core { mod std { pub use clone; pub use cmp; - #[cfg(stage0)] - pub use marker as kinds; pub use marker; pub use option; pub use fmt; diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 347a958076d..dff27f800c7 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -5065,7 +5065,5 @@ pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen corre #[doc(hidden)] #[cfg(not(test))] mod std { - #[cfg(stage0)] - pub use core::marker as kinds; pub use core::marker; } diff --git a/src/librand/lib.rs b/src/librand/lib.rs index ad2a4dbec4e..9d33f65cd59 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -495,8 +495,6 @@ pub struct Closed01(pub F); mod std { pub use core::{option, fmt}; // panic!() pub use core::clone; // derive Clone - #[cfg(stage0)] - pub use core::marker as kinds; pub use core::marker; } diff --git a/src/libregex/re.rs b/src/libregex/re.rs index 37f9869f3bf..acaf2e9b4cb 100644 --- a/src/libregex/re.rs +++ b/src/libregex/re.rs @@ -90,15 +90,6 @@ impl Clone for ExNative { } } -#[cfg(stage0)] -//FIXME: remove after stage0 snapshot -impl fmt::Show for Regex { - /// Shows the original regular expression. - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self.as_str(), f) - } -} - impl fmt::String for Regex { /// Shows the original regular expression. fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/librustc_back/svh.rs b/src/librustc_back/svh.rs index 863c1a7c865..4812a2948d1 100644 --- a/src/librustc_back/svh.rs +++ b/src/librustc_back/svh.rs @@ -120,9 +120,7 @@ impl Svh { impl fmt::Show for Svh { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - //NOTE(stage0): uncomment after snapshot - //write!(f, "Svh {{ {} }}", self.as_str()) - fmt::String::fmt(self, f) + write!(f, "Svh {{ {} }}", self.as_str()) } } diff --git a/src/librustdoc/html/escape.rs b/src/librustdoc/html/escape.rs index 99cd467cdfc..6fb78d9a833 100644 --- a/src/librustdoc/html/escape.rs +++ b/src/librustdoc/html/escape.rs @@ -19,14 +19,6 @@ use std::fmt; /// string when passed to a format string. pub struct Escape<'a>(pub &'a str); -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for Escape<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for Escape<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { // Because the internet is always right, turns out there's not that many diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index b24e7a7a4cf..c7ec687bc1a 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -64,14 +64,6 @@ impl UnsafetySpace { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for TyParamBounds<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for TyParamBounds<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let &TyParamBounds(bounds) = self; @@ -85,14 +77,6 @@ impl<'a> fmt::String for TyParamBounds<'a> { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::Generic { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::Generics { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if self.lifetimes.len() == 0 && self.type_params.len() == 0 { return Ok(()) } @@ -130,14 +114,6 @@ impl fmt::String for clean::Generics { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for WhereClause<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for WhereClause<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let &WhereClause(gens) = self; @@ -175,14 +151,6 @@ impl<'a> fmt::String for WhereClause<'a> { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::Lifetime { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::Lifetime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(f.write_str(self.get_ref())); @@ -190,14 +158,6 @@ impl fmt::String for clean::Lifetime { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::PolyTrait { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::PolyTrait { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if self.lifetimes.len() > 0 { @@ -214,14 +174,6 @@ impl fmt::String for clean::PolyTrait { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::TyParamBound { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::TyParamBound { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -239,14 +191,6 @@ impl fmt::String for clean::TyParamBound { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::PathParameters { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::PathParameters { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -292,14 +236,6 @@ impl fmt::String for clean::PathParameters { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::PathSegment { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::PathSegment { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(f.write_str(self.name.as_slice())); @@ -307,14 +243,6 @@ impl fmt::String for clean::PathSegment { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::Path { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::Path { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if self.global { @@ -501,14 +429,6 @@ fn tybounds(w: &mut fmt::Formatter, } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::Type { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::Type { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -650,15 +570,6 @@ impl fmt::String for clean::Type { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::Arguments { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - - impl fmt::String for clean::Arguments { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for (i, input) in self.values.iter().enumerate() { @@ -672,14 +583,6 @@ impl fmt::String for clean::Arguments { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::FunctionRetTy { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::FunctionRetTy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -690,28 +593,12 @@ impl fmt::String for clean::FunctionRetTy { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::FnDecl { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::FnDecl { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "({args}){arrow}", args = self.inputs, arrow = self.output) } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for Method<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for Method<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let Method(selfty, d) = *self; @@ -742,14 +629,6 @@ impl<'a> fmt::String for Method<'a> { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for VisSpace { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for VisSpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.get() { @@ -759,14 +638,6 @@ impl fmt::String for VisSpace { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for UnsafetySpace { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for UnsafetySpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.get() { @@ -776,14 +647,6 @@ impl fmt::String for UnsafetySpace { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::ViewPath { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::ViewPath { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -811,14 +674,6 @@ impl fmt::String for clean::ViewPath { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::ImportSource { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::ImportSource { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.did { @@ -836,14 +691,6 @@ impl fmt::String for clean::ImportSource { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for clean::ViewListIdent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for clean::ViewListIdent { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.source { @@ -865,14 +712,6 @@ impl fmt::String for clean::ViewListIdent { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for MutableSpace { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for MutableSpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -882,14 +721,6 @@ impl fmt::String for MutableSpace { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for RawMutableSpace { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for RawMutableSpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -899,14 +730,6 @@ impl fmt::String for RawMutableSpace { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for Stability<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for Stability<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let Stability(stab) = *self; @@ -921,14 +744,6 @@ impl<'a> fmt::String for Stability<'a> { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for ConciseStability<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for ConciseStability<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let ConciseStability(stab) = *self; @@ -946,14 +761,6 @@ impl<'a> fmt::String for ConciseStability<'a> { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for ModuleSummary { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for ModuleSummary { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt_inner<'a>(f: &mut fmt::Formatter, diff --git a/src/librustdoc/html/item_type.rs b/src/librustdoc/html/item_type.rs index 13a06f842a2..db3319eb765 100644 --- a/src/librustdoc/html/item_type.rs +++ b/src/librustdoc/html/item_type.rs @@ -103,14 +103,6 @@ impl ItemType { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl fmt::Show for ItemType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for ItemType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.to_static_str().fmt(f) diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index f4660a81be4..a063191a12f 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -435,14 +435,6 @@ pub fn reset_headers() { TEST_IDX.with(|s| s.set(0)); } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for Markdown<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for Markdown<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let Markdown(md) = *self; @@ -452,14 +444,6 @@ impl<'a> fmt::String for Markdown<'a> { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for MarkdownWithToc<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for MarkdownWithToc<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let MarkdownWithToc(md) = *self; diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 08abdc2af18..839dfa339b3 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1351,14 +1351,6 @@ impl<'a> Item<'a> { } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for Item<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for Item<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { // Write the breadcrumb trail header for the top @@ -1634,14 +1626,6 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context, struct Initializer<'a>(&'a str); -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for Initializer<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for Initializer<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let Initializer(s) = *self; @@ -2204,14 +2188,6 @@ fn item_typedef(w: &mut fmt::Formatter, it: &clean::Item, document(w, it) } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for Sidebar<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for Sidebar<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let cx = self.cx; @@ -2267,14 +2243,6 @@ impl<'a> fmt::String for Sidebar<'a> { } } -//NOTE(stage0): remove impl after snapshot -#[cfg(stage0)] -impl<'a> fmt::Show for Source<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a> fmt::String for Source<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let Source(s) = *self; diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index b7bf40a6ec5..fd0b5c55903 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -2458,14 +2458,6 @@ impl<'a> fmt::String for PrettyJson<'a> { } } -#[cfg(stage0)] -//NOTE(stage0): remove impl after snapshot -impl<'a, T: Encodable> fmt::Show for AsJson<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl<'a, T: Encodable> fmt::String for AsJson<'a, T> { /// Encodes a json value into a string fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 139170fc012..f0a51fcea18 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -25,7 +25,6 @@ Core encoding and decoding interfaces. #![allow(unknown_features)] #![feature(slicing_syntax)] #![feature(old_impl_check)] -#![cfg_attr(stage0, allow(unused_attributes))] // test harness access #[cfg(test)] extern crate test; diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 9ef9081bc3c..2595a3c44a8 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1783,9 +1783,8 @@ pub struct UnstableFileStat { } -// NOTE(stage0): change this one last #[doc=..] to /// after the next snapshot bitflags! { - #[doc = "A set of permissions for a file or directory is represented by a set of"] + /// A set of permissions for a file or directory is represented by a set of /// flags which are or'd together. flags FilePermission: u32 { const USER_READ = 0o400, diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index 55df6330dd3..879f1192a4a 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -395,13 +395,6 @@ impl Command { } } -#[cfg(stage0)] -impl fmt::Show for Command { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for Command { /// Format the program and arguments of a Command for display. Any /// non-utf8 data is lossily converted using the utf8 replacement diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index eef5bdb60ee..60612f4dbaa 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -108,7 +108,6 @@ #![feature(lang_items, unsafe_destructor)] #![feature(slicing_syntax, unboxed_closures)] #![feature(old_impl_check)] -#![cfg_attr(stage0, allow(unused_attributes))] // Don't link to std. We are std. #![no_std] @@ -152,7 +151,6 @@ pub use core::default; pub use core::finally; pub use core::intrinsics; pub use core::iter; -#[cfg(stage0)] #[cfg(not(test))] pub use core::marker as kinds; #[cfg(not(test))] pub use core::marker; pub use core::mem; #[cfg(not(test))] pub use core::ops; @@ -284,8 +282,6 @@ mod std { pub use vec; // used for vec![] pub use cell; // used for tls! pub use thread_local; // used for thread_local! - #[cfg(stage0)] - pub use marker as kinds; pub use marker; // used for tls! pub use ops; // used for bitflags! diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index 581969e98fb..aa59d60d7a4 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -823,7 +823,6 @@ pub struct Display<'a, P:'a> { filename: bool } -//NOTE(stage0): replace with deriving(Show) after snapshot impl<'a, P: GenericPath> fmt::Show for Display<'a, P> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::String::fmt(self, f) diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 6766127a5f1..e73d5258d4c 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -100,7 +100,6 @@ impl Ident { } } -//NOTE(stage0): remove after snapshot impl fmt::Show for Ident { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}#{}", self.name, self.ctxt) @@ -1085,7 +1084,6 @@ pub enum IntTy { TyI64, } -//NOTE(stage0): remove after snapshot impl fmt::Show for IntTy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::String::fmt(self, f) @@ -1127,7 +1125,6 @@ impl UintTy { } } -//NOTE(stage0): remove after snapshot impl fmt::Show for UintTy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::String::fmt(self, f) @@ -1146,7 +1143,6 @@ pub enum FloatTy { TyF64, } -//NOTE(stage0): remove after snapshot impl fmt::Show for FloatTy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::String::fmt(self, f) diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index 7496a0f9f26..eb725b6d885 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -32,7 +32,7 @@ use std::slice; pub mod blocks; -#[derive(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq, Show)] pub enum PathElem { PathMod(Name), PathName(Name) @@ -46,13 +46,6 @@ impl PathElem { } } -//NOTE(stage0): replace with deriving(Show) after snapshot -impl fmt::Show for PathElem { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::String::fmt(self, f) - } -} - impl fmt::String for PathElem { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let slot = token::get_name(self.name()); diff --git a/src/snapshots.txt b/src/snapshots.txt index d6134898cbd..aa31974c67a 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,12 @@ +S 2015-01-07 9e4e524 + freebsd-x86_64 2563d33151bce1bbe08a85d712564bddc7503fc6 + linux-i386 d8b73fc9aa3ad72ce1408a41e35d78dba10eb4d4 + linux-x86_64 697880d3640e981bbbf23284363e8e9a158b588d + macos-i386 a73b1fc03e8cac747aab0aa186292bb4332a7a98 + macos-x86_64 e4ae2670ea4ba5c2e5b4245409c9cab45c9eeb5b + winnt-i386 ddffa59d9605aa05e83e8f664db802da512611e9 + winnt-x86_64 a56261ebbc580c6c14b1c1d0be25010f5201dc3f + S 2015-01-06 340ac04 freebsd-x86_64 5413b8931d7076e90c873e0cc7a43e0793c2b17a linux-i386 cacb8e3ad15937916e455d8f63e740c30a807b10 From 7deb9abd1b45f3e56ca6b13432866ae89886f21f Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Wed, 7 Jan 2015 10:39:37 -0800 Subject: [PATCH 2/3] Add isize, usize modules, deprecate int, uint modules This PR introduces `isize` and `usize` modules to `core` and `std`, and deprecates the existing `int` and `uint` modules. The rustdoc primitive type links now point to these new modules. Due to deprecation this is a: [breaking-change] --- src/libcore/lib.rs | 2 ++ src/libcore/num/int.rs | 9 ++++++--- src/libcore/num/isize.rs | 21 +++++++++++++++++++++ src/libcore/num/uint.rs | 9 ++++++--- src/libcore/num/usize.rs | 20 ++++++++++++++++++++ src/libstd/lib.rs | 2 ++ src/libstd/num/int.rs | 9 ++++++--- src/libstd/num/isize.rs | 22 ++++++++++++++++++++++ src/libstd/num/uint.rs | 9 ++++++--- src/libstd/num/usize.rs | 22 ++++++++++++++++++++++ 10 files changed, 113 insertions(+), 12 deletions(-) create mode 100644 src/libcore/num/isize.rs create mode 100644 src/libcore/num/usize.rs create mode 100644 src/libstd/num/isize.rs create mode 100644 src/libstd/num/usize.rs diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index ea5d37810cc..890417b133f 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -78,12 +78,14 @@ mod int_macros; mod uint_macros; #[path = "num/int.rs"] pub mod int; +#[path = "num/isize.rs"] pub mod isize; #[path = "num/i8.rs"] pub mod i8; #[path = "num/i16.rs"] pub mod i16; #[path = "num/i32.rs"] pub mod i32; #[path = "num/i64.rs"] pub mod i64; #[path = "num/uint.rs"] pub mod uint; +#[path = "num/usize.rs"] pub mod usize; #[path = "num/u8.rs"] pub mod u8; #[path = "num/u16.rs"] pub mod u16; #[path = "num/u32.rs"] pub mod u32; diff --git a/src/libcore/num/int.rs b/src/libcore/num/int.rs index 91c5e4163f9..fe68b78b2b6 100644 --- a/src/libcore/num/int.rs +++ b/src/libcore/num/int.rs @@ -8,10 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! Operations and constants for architecture-sized signed integers (`int` type) +//! Deprecated: replaced by `isize`. +//! +//! The rollout of the new type will gradually take place over the +//! alpha cycle along with the development of clearer conventions +//! around integer types. -#![stable] -#![doc(primitive = "int")] +#![deprecated = "replaced by isize"] #[cfg(target_word_size = "32")] int_module! { int, 32 } #[cfg(target_word_size = "64")] int_module! { int, 64 } diff --git a/src/libcore/num/isize.rs b/src/libcore/num/isize.rs new file mode 100644 index 00000000000..5348f6dd50d --- /dev/null +++ b/src/libcore/num/isize.rs @@ -0,0 +1,21 @@ +// Copyright 2012-2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Operations and constants for pointer-sized signed integers (`isize` type) +//! +//! This type was recently added to replace `int`. The rollout of the +//! new type will gradually take place over the alpha cycle along with +//! the development of clearer conventions around integer types. + +#![stable] +#![doc(primitive = "isize")] + +#[cfg(target_word_size = "32")] int_module! { isize, 32 } +#[cfg(target_word_size = "64")] int_module! { isize, 64 } diff --git a/src/libcore/num/uint.rs b/src/libcore/num/uint.rs index 35739f68da9..7931890ca5e 100644 --- a/src/libcore/num/uint.rs +++ b/src/libcore/num/uint.rs @@ -8,9 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! Operations and constants for architecture-sized unsigned integers (`uint` type) +//! Deprecated: replaced by `usize`. +//! +//! The rollout of the new type will gradually take place over the +//! alpha cycle along with the development of clearer conventions +//! around integer types. -#![stable] -#![doc(primitive = "uint")] +#![deprecated = "replaced by usize"] uint_module! { uint, int, ::int::BITS } diff --git a/src/libcore/num/usize.rs b/src/libcore/num/usize.rs new file mode 100644 index 00000000000..5eebcd51a77 --- /dev/null +++ b/src/libcore/num/usize.rs @@ -0,0 +1,20 @@ +// Copyright 2012-2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Operations and constants for pointer-sized unsigned integers (`usize` type) +//! +//! This type was recently added to replace `uint`. The rollout of the +//! new type will gradually take place over the alpha cycle along with +//! the development of clearer conventions around integer types. + +#![stable] +#![doc(primitive = "usize")] + +uint_module! { usize, isize, ::isize::BITS } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 60612f4dbaa..fa8cc6f4a18 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -201,12 +201,14 @@ mod int_macros; mod uint_macros; #[path = "num/int.rs"] pub mod int; +#[path = "num/isize.rs"] pub mod isize; #[path = "num/i8.rs"] pub mod i8; #[path = "num/i16.rs"] pub mod i16; #[path = "num/i32.rs"] pub mod i32; #[path = "num/i64.rs"] pub mod i64; #[path = "num/uint.rs"] pub mod uint; +#[path = "num/usize.rs"] pub mod usize; #[path = "num/u8.rs"] pub mod u8; #[path = "num/u16.rs"] pub mod u16; #[path = "num/u32.rs"] pub mod u32; diff --git a/src/libstd/num/int.rs b/src/libstd/num/int.rs index 9ccb1544fdc..69439f85115 100644 --- a/src/libstd/num/int.rs +++ b/src/libstd/num/int.rs @@ -8,10 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! Operations and constants for architecture-sized signed integers (`int` type) +//! Deprecated: replaced by `isize`. +//! +//! The rollout of the new type will gradually take place over the +//! alpha cycle along with the development of clearer conventions +//! around integer types. -#![stable] -#![doc(primitive = "int")] +#![deprecated = "replaced by isize"] pub use core::int::{BITS, BYTES, MIN, MAX}; diff --git a/src/libstd/num/isize.rs b/src/libstd/num/isize.rs new file mode 100644 index 00000000000..22395a1c0ff --- /dev/null +++ b/src/libstd/num/isize.rs @@ -0,0 +1,22 @@ +// Copyright 2012-2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Operations and constants for pointer-sized signed integers (`isize` type) +//! +//! This type was recently added to replace `int`. The rollout of the +//! new type will gradually take place over the alpha cycle along with +//! the development of clearer conventions around integer types. + +#![stable] +#![doc(primitive = "isize")] + +pub use core::isize::{BITS, BYTES, MIN, MAX}; + +int_module! { isize } diff --git a/src/libstd/num/uint.rs b/src/libstd/num/uint.rs index 0fbc0953b20..0e12eff205f 100644 --- a/src/libstd/num/uint.rs +++ b/src/libstd/num/uint.rs @@ -8,10 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! Operations and constants for architecture-sized unsigned integers (`uint` type) +//! Deprecated: replaced by `usize`. +//! +//! The rollout of the new type will gradually take place over the +//! alpha cycle along with the development of clearer conventions +//! around integer types. -#![stable] -#![doc(primitive = "uint")] +#![deprecated = "replaced by usize"] pub use core::uint::{BITS, BYTES, MIN, MAX}; diff --git a/src/libstd/num/usize.rs b/src/libstd/num/usize.rs new file mode 100644 index 00000000000..74dd38e13c5 --- /dev/null +++ b/src/libstd/num/usize.rs @@ -0,0 +1,22 @@ +// Copyright 2012-2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Operations and constants for pointer-sized unsigned integers (`usize` type) +//! +//! This type was recently added to replace `uint`. The rollout of the +//! new type will gradually take place over the alpha cycle along with +//! the development of clearer conventions around integer types. + +#![stable] +#![doc(primitive = "usize")] + +pub use core::usize::{BITS, BYTES, MIN, MAX}; + +uint_module! { usize } From 321d9ddff21b532300a9ced6ae7ce5f902c0fbf5 Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Wed, 7 Jan 2015 12:14:59 -0800 Subject: [PATCH 3/3] Update references to old snapshot --- src/librustc_typeck/check/_match.rs | 2 +- src/test/compile-fail/mut-pattern-mismatched.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index d9829fd1416..4d3715afddf 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -195,7 +195,7 @@ pub fn check_pat<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, ast::PatRegion(ref inner, mutbl) => { let inner_ty = fcx.infcx().next_ty_var(); - // SNAP 340ac04 remove this `if`-`else` entirely after next snapshot + // SNAP 9e4e524 remove this `if`-`else` entirely after next snapshot let mutbl = if mutbl == ast::MutImmutable { ty::deref(fcx.infcx().shallow_resolve(expected), true) .map(|mt| mt.mutbl).unwrap_or(ast::MutImmutable) diff --git a/src/test/compile-fail/mut-pattern-mismatched.rs b/src/test/compile-fail/mut-pattern-mismatched.rs index 443be7d7b69..f945308b92a 100644 --- a/src/test/compile-fail/mut-pattern-mismatched.rs +++ b/src/test/compile-fail/mut-pattern-mismatched.rs @@ -13,7 +13,7 @@ fn main() { // (separate lines to ensure the spans are accurate) - // SNAP 340ac04 uncomment this after the next snapshot + // SNAP 9e4e524 uncomment this after the next snapshot // NOTE(stage0) just in case tidy doesn't check snap's in tests // let &_ // ~ ERROR expected `&mut isize`, found `&_` // = foo;