From 76db37ee4b916a678181b36e42c26d92524e7041 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 28 Jul 2015 15:44:30 -0700 Subject: std: Stabilize a number of small APIs The following APIs were all marked with a `#[stable]` tag: * process::Child::id * error::Error::is * error::Error::downcast * error::Error::downcast_ref * error::Error::downcast_mut * io::Error::get_ref * io::Error::get_mut * io::Error::into_inner * hash::Hash::hash_slice * hash::Hasher::write_{i,u}{8,16,32,64,size} --- src/libstd/io/error.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/libstd/io') diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index 3b48ff30960..e12e202148b 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -219,8 +219,7 @@ impl Error { /// /// If this `Error` was constructed via `new` then this function will /// return `Some`, otherwise it will return `None`. - #[unstable(feature = "io_error_inner", - reason = "recently added and requires UFCS to downcast")] + #[stable(feature = "io_error_inner", since = "1.3.0")] pub fn get_ref(&self) -> Option<&(error::Error+Send+Sync+'static)> { match self.repr { Repr::Os(..) => None, @@ -233,8 +232,7 @@ impl Error { /// /// If this `Error` was constructed via `new` then this function will /// return `Some`, otherwise it will return `None`. - #[unstable(feature = "io_error_inner", - reason = "recently added and requires UFCS to downcast")] + #[stable(feature = "io_error_inner", since = "1.3.0")] pub fn get_mut(&mut self) -> Option<&mut (error::Error+Send+Sync+'static)> { match self.repr { Repr::Os(..) => None, @@ -246,8 +244,7 @@ impl Error { /// /// If this `Error` was constructed via `new` then this function will /// return `Some`, otherwise it will return `None`. - #[unstable(feature = "io_error_inner", - reason = "recently added and requires UFCS to downcast")] + #[stable(feature = "io_error_inner", since = "1.3.0")] pub fn into_inner(self) -> Option> { match self.repr { Repr::Os(..) => None, @@ -349,10 +346,10 @@ mod test { // we have to call all of these UFCS style right now since method // resolution won't implicitly drop the Send+Sync bounds let mut err = Error::new(ErrorKind::Other, TestError); - assert!(error::Error::is::(err.get_ref().unwrap())); + assert!(err.get_ref().unwrap().is::()); assert_eq!("asdf", err.get_ref().unwrap().description()); - assert!(error::Error::is::(err.get_mut().unwrap())); + assert!(err.get_mut().unwrap().is::()); let extracted = err.into_inner().unwrap(); - error::Error::downcast::(extracted).unwrap(); + extracted.downcast::().unwrap(); } } -- cgit 1.4.1-3-g733a5