diff options
| author | bors <bors@rust-lang.org> | 2015-09-13 19:45:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-13 19:45:15 +0000 |
| commit | cedbd998a4669e026b2a1b34de95d91cd0fde1a5 (patch) | |
| tree | c201a78235b82e78e92cd4f5b51d7022ffddfea6 /src/libstd | |
| parent | c494cf1d01befbc85247a4bb82c3d15cadcfedeb (diff) | |
| parent | f0b1326dc79e186f89b65336ae85f3a8ac6db4c1 (diff) | |
| download | rust-cedbd998a4669e026b2a1b34de95d91cd0fde1a5.tar.gz rust-cedbd998a4669e026b2a1b34de95d91cd0fde1a5.zip | |
Auto merge of #28339 - alexcrichton:stabilize-1.4, r=aturon
The FCP is coming to a close and 1.4 is coming out soon, so this brings in the libs team decision for all library features this cycle. Stabilized APIs: * `<Box<str>>::into_string` * `Arc::downgrade` * `Arc::get_mut` * `Arc::make_mut` * `Arc::try_unwrap` * `Box::from_raw` * `Box::into_raw` * `CStr::to_str` * `CStr::to_string_lossy` * `CString::from_raw` * `CString::into_raw` * `IntoRawFd::into_raw_fd` * `IntoRawFd` * `IntoRawHandle::into_raw_handle` * `IntoRawHandle` * `IntoRawSocket::into_raw_socket` * `IntoRawSocket` * `Rc::downgrade` * `Rc::get_mut` * `Rc::make_mut` * `Rc::try_unwrap` * `Result::expect` * `String::into_boxed_slice` * `TcpSocket::read_timeout` * `TcpSocket::set_read_timeout` * `TcpSocket::set_write_timeout` * `TcpSocket::write_timeout` * `UdpSocket::read_timeout` * `UdpSocket::set_read_timeout` * `UdpSocket::set_write_timeout` * `UdpSocket::write_timeout` * `Vec::append` * `Vec::split_off` * `VecDeque::append` * `VecDeque::retain` * `VecDeque::split_off` * `rc::Weak::upgrade` * `rc::Weak` * `slice::Iter::as_slice` * `slice::IterMut::into_slice` * `str::CharIndices::as_str` * `str::Chars::as_str` * `str::split_at_mut` * `str::split_at` * `sync::Weak::upgrade` * `sync::Weak` * `thread::park_timeout` * `thread::sleep` Deprecated APIs * `BTreeMap::with_b` * `BTreeSet::with_b` * `Option::as_mut_slice` * `Option::as_slice` * `Result::as_mut_slice` * `Result::as_slice` * `f32::from_str_radix` * `f64::from_str_radix` Closes #27277 Closes #27718 Closes #27736 Closes #27764 Closes #27765 Closes #27766 Closes #27767 Closes #27768 Closes #27769 Closes #27771 Closes #27773 Closes #27775 Closes #27776 Closes #27785 Closes #27792 Closes #27795 Closes #27797
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ffi/c_str.rs | 18 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 1 | ||||
| -rw-r--r-- | src/libstd/net/tcp.rs | 24 | ||||
| -rw-r--r-- | src/libstd/net/udp.rs | 24 | ||||
| -rw-r--r-- | src/libstd/num/f32.rs | 2 | ||||
| -rw-r--r-- | src/libstd/num/f64.rs | 2 | ||||
| -rw-r--r-- | src/libstd/primitive_docs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext/io.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/windows/ext/io.rs | 12 | ||||
| -rw-r--r-- | src/libstd/thread/mod.rs | 6 |
10 files changed, 59 insertions, 40 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 587eb0f1cea..3a1853a7a6c 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -119,7 +119,7 @@ pub struct CString { /// Converting a foreign C string into a Rust `String` /// /// ```no_run -/// # #![feature(libc,cstr_to_str)] +/// # #![feature(libc)] /// extern crate libc; /// use std::ffi::CStr; /// @@ -205,7 +205,7 @@ impl CString { /// The only appropriate argument is a pointer obtained by calling /// `into_ptr`. The length of the string will be recalculated /// using the pointer. - #[unstable(feature = "cstr_memory", reason = "recently added", + #[unstable(feature = "cstr_memory2", reason = "recently added", issue = "27769")] #[deprecated(since = "1.4.0", reason = "renamed to from_raw")] pub unsafe fn from_ptr(ptr: *const libc::c_char) -> CString { @@ -217,8 +217,7 @@ impl CString { /// The only appropriate argument is a pointer obtained by calling /// `into_raw`. The length of the string will be recalculated /// using the pointer. - #[unstable(feature = "cstr_memory", reason = "recently added", - issue = "27769")] + #[stable(feature = "cstr_memory", since = "1.4.0")] pub unsafe fn from_raw(ptr: *mut libc::c_char) -> CString { let len = libc::strlen(ptr) + 1; // Including the NUL byte let slice = slice::from_raw_parts(ptr, len as usize); @@ -233,7 +232,7 @@ impl CString { /// this string. /// /// Failure to call `from_raw` will lead to a memory leak. - #[unstable(feature = "cstr_memory", reason = "recently added", + #[unstable(feature = "cstr_memory2", reason = "recently added", issue = "27769")] #[deprecated(since = "1.4.0", reason = "renamed to into_raw")] pub fn into_ptr(self) -> *const libc::c_char { @@ -248,8 +247,7 @@ impl CString { /// this string. /// /// Failure to call `from_ptr` will lead to a memory leak. - #[unstable(feature = "cstr_memory", reason = "recently added", - issue = "27769")] + #[stable(feature = "cstr_memory", since = "1.4.0")] pub fn into_raw(self) -> *mut libc::c_char { Box::into_raw(self.inner) as *mut libc::c_char } @@ -429,8 +427,7 @@ impl CStr { /// > after a 0-cost cast, but it is planned to alter its definition in the /// > future to perform the length calculation in addition to the UTF-8 /// > check whenever this method is called. - #[unstable(feature = "cstr_to_str", reason = "recently added", - issue = "27764")] + #[stable(feature = "cstr_to_str", since = "1.4.0")] pub fn to_str(&self) -> Result<&str, str::Utf8Error> { // NB: When CStr is changed to perform the length check in .to_bytes() // instead of in from_ptr(), it may be worth considering if this should @@ -450,8 +447,7 @@ impl CStr { /// > after a 0-cost cast, but it is planned to alter its definition in the /// > future to perform the length calculation in addition to the UTF-8 /// > check whenever this method is called. - #[unstable(feature = "cstr_to_str", reason = "recently added", - issue = "27764")] + #[stable(feature = "cstr_to_str", since = "1.4.0")] pub fn to_string_lossy(&self) -> Cow<str> { String::from_utf8_lossy(self.to_bytes()) } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index fca4c66112e..868fef06aa4 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -203,7 +203,6 @@ #![feature(allow_internal_unstable)] #![feature(associated_consts)] #![feature(borrow_state)] -#![feature(box_raw)] #![feature(box_syntax)] #![feature(char_from_unchecked)] #![feature(char_internals)] diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index 5467a8575ff..d563ba0b620 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -130,8 +130,13 @@ impl TcpStream { /// If the value specified is `None`, then `read` calls will block /// indefinitely. It is an error to pass the zero `Duration` to this /// method. - #[unstable(feature = "socket_timeout", reason = "RFC 1047 - recently added", - issue = "27773")] + /// + /// # Note + /// + /// Platforms may return a different error code whenever a read times out as + /// a result of setting this option. For example Unix typically returns an + /// error of the kind `WouldBlock`, but Windows may return `TimedOut`. + #[stable(feature = "socket_timeout", since = "1.4.0")] pub fn set_read_timeout(&self, dur: Option<Duration>) -> io::Result<()> { self.0.set_read_timeout(dur) } @@ -141,8 +146,13 @@ impl TcpStream { /// If the value specified is `None`, then `write` calls will block /// indefinitely. It is an error to pass the zero `Duration` to this /// method. - #[unstable(feature = "socket_timeout", reason = "RFC 1047 - recently added", - issue = "27773")] + /// + /// # Note + /// + /// Platforms may return a different error code whenever a write times out + /// as a result of setting this option. For example Unix typically returns + /// an error of the kind `WouldBlock`, but Windows may return `TimedOut`. + #[stable(feature = "socket_timeout", since = "1.4.0")] pub fn set_write_timeout(&self, dur: Option<Duration>) -> io::Result<()> { self.0.set_write_timeout(dur) } @@ -154,8 +164,7 @@ impl TcpStream { /// # Note /// /// Some platforms do not provide access to the current timeout. - #[unstable(feature = "socket_timeout", reason = "RFC 1047 - recently added", - issue = "27773")] + #[stable(feature = "socket_timeout", since = "1.4.0")] pub fn read_timeout(&self) -> io::Result<Option<Duration>> { self.0.read_timeout() } @@ -167,8 +176,7 @@ impl TcpStream { /// # Note /// /// Some platforms do not provide access to the current timeout. - #[unstable(feature = "socket_timeout", reason = "RFC 1047 - recently added", - issue = "27773")] + #[stable(feature = "socket_timeout", since = "1.4.0")] pub fn write_timeout(&self) -> io::Result<Option<Duration>> { self.0.write_timeout() } diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs index dcb76161d1f..74c4416b35b 100644 --- a/src/libstd/net/udp.rs +++ b/src/libstd/net/udp.rs @@ -97,8 +97,13 @@ impl UdpSocket { /// If the value specified is `None`, then `read` calls will block /// indefinitely. It is an error to pass the zero `Duration` to this /// method. - #[unstable(feature = "socket_timeout", reason = "RFC 1047 - recently added", - issue = "27773")] + /// + /// # Note + /// + /// Platforms may return a different error code whenever a read times out as + /// a result of setting this option. For example Unix typically returns an + /// error of the kind `WouldBlock`, but Windows may return `TimedOut`. + #[stable(feature = "socket_timeout", since = "1.4.0")] pub fn set_read_timeout(&self, dur: Option<Duration>) -> io::Result<()> { self.0.set_read_timeout(dur) } @@ -108,8 +113,13 @@ impl UdpSocket { /// If the value specified is `None`, then `write` calls will block /// indefinitely. It is an error to pass the zero `Duration` to this /// method. - #[unstable(feature = "socket_timeout", reason = "RFC 1047 - recently added", - issue = "27773")] + /// + /// # Note + /// + /// Platforms may return a different error code whenever a write times out + /// as a result of setting this option. For example Unix typically returns + /// an error of the kind `WouldBlock`, but Windows may return `TimedOut`. + #[stable(feature = "socket_timeout", since = "1.4.0")] pub fn set_write_timeout(&self, dur: Option<Duration>) -> io::Result<()> { self.0.set_write_timeout(dur) } @@ -117,8 +127,7 @@ impl UdpSocket { /// Returns the read timeout of this socket. /// /// If the timeout is `None`, then `read` calls will block indefinitely. - #[unstable(feature = "socket_timeout", reason = "RFC 1047 - recently added", - issue = "27773")] + #[stable(feature = "socket_timeout", since = "1.4.0")] pub fn read_timeout(&self) -> io::Result<Option<Duration>> { self.0.read_timeout() } @@ -126,8 +135,7 @@ impl UdpSocket { /// Returns the write timeout of this socket. /// /// If the timeout is `None`, then `write` calls will block indefinitely. - #[unstable(feature = "socket_timeout", reason = "RFC 1047 - recently added", - issue = "27773")] + #[stable(feature = "socket_timeout", since = "1.4.0")] pub fn write_timeout(&self) -> io::Result<Option<Duration>> { self.0.write_timeout() } diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 62f6cfcb36f..a04dfbeebe8 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -125,6 +125,8 @@ impl f32 { /// Parses a float as with a given radix #[unstable(feature = "float_from_str_radix", reason = "recently moved API", issue = "27736")] + #[deprecated(since = "1.4.0", + reason = "unclear how useful or correct this is")] pub fn from_str_radix(s: &str, radix: u32) -> Result<f32, ParseFloatError> { num::Float::from_str_radix(s, radix) } diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 252a941d86c..329d3329be6 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -82,6 +82,8 @@ impl f64 { /// Parses a float as with a given radix #[unstable(feature = "float_from_str_radix", reason = "recently moved API", issue = "27736")] + #[deprecated(since = "1.4.0", + reason = "unclear how useful or correct this is")] pub fn from_str_radix(s: &str, radix: u32) -> Result<f64, ParseFloatError> { num::Float::from_str_radix(s, radix) } diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index 7f14ea93c52..f2ae168e560 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -111,8 +111,6 @@ mod prim_unit { } /// the raw pointer. It doesn't destroy `T` or deallocate any memory. /// /// ``` -/// #![feature(box_raw)] -/// /// let my_speed: Box<i32> = Box::new(88); /// let my_speed: *mut i32 = Box::into_raw(my_speed); /// diff --git a/src/libstd/sys/unix/ext/io.rs b/src/libstd/sys/unix/ext/io.rs index f4184f6a5d5..52ac37c6e33 100644 --- a/src/libstd/sys/unix/ext/io.rs +++ b/src/libstd/sys/unix/ext/io.rs @@ -61,14 +61,14 @@ pub trait FromRawFd { /// A trait to express the ability to consume an object and acquire ownership of /// its raw file descriptor. -#[unstable(feature = "into_raw_os", reason = "recently added API", - issue = "27797")] +#[stable(feature = "into_raw_os", since = "1.4.0")] pub trait IntoRawFd { /// Consumes this object, returning the raw underlying file descriptor. /// /// This function **transfers ownership** of the underlying file descriptor /// to the caller. Callers are then the unique owners of the file descriptor /// and must close the descriptor once it's no longer needed. + #[stable(feature = "into_raw_os", since = "1.4.0")] fn into_raw_fd(self) -> RawFd; } @@ -84,6 +84,7 @@ impl FromRawFd for fs::File { fs::File::from_inner(sys::fs::File::from_inner(fd)) } } +#[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawFd for fs::File { fn into_raw_fd(self) -> RawFd { self.into_inner().into_fd().into_raw() @@ -125,16 +126,19 @@ impl FromRawFd for net::UdpSocket { } } +#[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawFd for net::TcpStream { fn into_raw_fd(self) -> RawFd { self.into_inner().into_socket().into_inner() } } +#[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawFd for net::TcpListener { fn into_raw_fd(self) -> RawFd { self.into_inner().into_socket().into_inner() } } +#[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawFd for net::UdpSocket { fn into_raw_fd(self) -> RawFd { self.into_inner().into_socket().into_inner() diff --git a/src/libstd/sys/windows/ext/io.rs b/src/libstd/sys/windows/ext/io.rs index a203a23068e..9f10b0e8563 100644 --- a/src/libstd/sys/windows/ext/io.rs +++ b/src/libstd/sys/windows/ext/io.rs @@ -52,14 +52,14 @@ pub trait FromRawHandle { /// A trait to express the ability to consume an object and acquire ownership of /// its raw `HANDLE`. -#[unstable(feature = "into_raw_os", reason = "recently added API", - issue = "27797")] +#[stable(feature = "into_raw_os", since = "1.4.0")] pub trait IntoRawHandle { /// Consumes this object, returning the raw underlying handle. /// /// This function **transfers ownership** of the underlying handle to the /// caller. Callers are then the unique owners of the handle and must close /// it once it's no longer needed. + #[stable(feature = "into_raw_os", since = "1.4.0")] fn into_raw_handle(self) -> RawHandle; } @@ -78,6 +78,7 @@ impl FromRawHandle for fs::File { } } +#[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawHandle for fs::File { fn into_raw_handle(self) -> RawHandle { self.into_inner().into_handle().into_raw() as *mut _ @@ -111,14 +112,14 @@ pub trait FromRawSocket { /// A trait to express the ability to consume an object and acquire ownership of /// its raw `SOCKET`. -#[unstable(feature = "into_raw_os", reason = "recently added API", - issue = "27797")] +#[stable(feature = "into_raw_os", since = "1.4.0")] pub trait IntoRawSocket { /// Consumes this object, returning the raw underlying socket. /// /// This function **transfers ownership** of the underlying socket to the /// caller. Callers are then the unique owners of the socket and must close /// it once it's no longer needed. + #[stable(feature = "into_raw_os", since = "1.4.0")] fn into_raw_socket(self) -> RawSocket; } @@ -163,18 +164,21 @@ impl FromRawSocket for net::UdpSocket { } } +#[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawSocket for net::TcpStream { fn into_raw_socket(self) -> RawSocket { self.into_inner().into_socket().into_inner() } } +#[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawSocket for net::TcpListener { fn into_raw_socket(self) -> RawSocket { self.into_inner().into_socket().into_inner() } } +#[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawSocket for net::UdpSocket { fn into_raw_socket(self) -> RawSocket { self.into_inner().into_socket().into_inner() diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 2b7a3deceb7..43c23ec8a47 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -411,8 +411,7 @@ pub fn sleep_ms(ms: u32) { /// signal being received or a spurious wakeup. Platforms which do not support /// nanosecond precision for sleeping will have `dur` rounded up to the nearest /// granularity of time they can sleep for. -#[unstable(feature = "thread_sleep", reason = "waiting on Duration", - issue = "27771")] +#[stable(feature = "thread_sleep", since = "1.4.0")] pub fn sleep(dur: Duration) { imp::Thread::sleep(dur) } @@ -482,8 +481,7 @@ pub fn park_timeout_ms(ms: u32) { /// /// Platforms which do not support nanosecond precision for sleeping will have /// `dur` rounded up to the nearest granularity of time they can sleep for. -#[unstable(feature = "park_timeout", reason = "waiting on Duration", - issue = "27771")] +#[stable(feature = "park_timeout", since = "1.4.0")] pub fn park_timeout(dur: Duration) { let thread = current(); let mut guard = thread.inner.lock.lock().unwrap(); |
