diff options
| author | bors <bors@rust-lang.org> | 2016-12-18 17:37:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-12-18 17:37:25 +0000 |
| commit | 1f965cc8e9dc8f8b26eac99cffdef6501cf0c617 (patch) | |
| tree | e0df29c8bc2f181da612f1685364c0eee24a15e1 /src/libstd | |
| parent | 8327b5afafde7cdd6fd4e939d9a8fe12f76503ef (diff) | |
| parent | 9a5cef4de51c1c90fb2d05b0c7e6feb9cf0224d6 (diff) | |
| download | rust-1f965cc8e9dc8f8b26eac99cffdef6501cf0c617.tar.gz rust-1f965cc8e9dc8f8b26eac99cffdef6501cf0c617.zip | |
Auto merge of #38369 - aturon:stab-1.15, r=alexcrichton
Library stabilizations/deprecations for 1.15 release
Stabilized:
- `std::iter::Iterator::{min_by, max_by}`
- `std::os::*::fs::FileExt`
- `std::sync::atomic::Atomic*::{get_mut, into_inner}`
- `std::vec::IntoIter::{as_slice, as_mut_slice}`
- `std::sync::mpsc::Receiver::try_iter`
- `std::os::unix::process::CommandExt::before_exec`
- `std::rc::Rc::{strong_count, weak_count}`
- `std::sync::Arc::{strong_count, weak_count}`
- `std::char::{encode_utf8, encode_utf16}`
- `std::cell::Ref::clone`
- `std::io::Take::into_inner`
Deprecated:
- `std::rc::Rc::{would_unwrap, is_unique}`
- `std::cell::RefCell::borrow_state`
Closes #23755
Closes #27733
Closes #27746
Closes #27784
Closes #28356
Closes #31398
Closes #34931
Closes #35601
Closes #35603
Closes #35918
Closes #36105
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/stdio.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/redox/ext/process.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext/fs.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext/process.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/ext/fs.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/windows/ext/mod.rs | 2 |
9 files changed, 19 insertions, 21 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index b3b89213df1..b07da0dc268 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1526,8 +1526,6 @@ impl<T> Take<T> { /// # Examples /// /// ``` - /// #![feature(io_take_into_inner)] - /// /// use std::io; /// use std::io::prelude::*; /// use std::fs::File; @@ -1543,7 +1541,7 @@ impl<T> Take<T> { /// # Ok(()) /// # } /// ``` - #[unstable(feature = "io_take_into_inner", issue = "23755")] + #[stable(feature = "io_take_into_inner", since = "1.15.0")] pub fn into_inner(self) -> T { self.inner } diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 6419a9ff683..1a65bee13b8 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -10,7 +10,7 @@ use io::prelude::*; -use cell::{RefCell, BorrowState}; +use cell::RefCell; use fmt; use io::lazy::Lazy; use io::{self, BufReader, LineWriter}; @@ -638,8 +638,8 @@ pub fn _print(args: fmt::Arguments) { LocalKeyState::Destroyed => stdout().write_fmt(args), LocalKeyState::Valid => { LOCAL_STDOUT.with(|s| { - if s.borrow_state() == BorrowState::Unused { - if let Some(w) = s.borrow_mut().as_mut() { + if let Ok(mut borrowed) = s.try_borrow_mut() { + if let Some(w) = borrowed.as_mut() { return w.write_fmt(args); } } diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 9f51d3e87f3..63745388eb6 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -316,7 +316,7 @@ pub struct Iter<'a, T: 'a> { /// /// This Iterator will never block the caller in order to wait for data to /// become available. Instead, it will return `None`. -#[unstable(feature = "receiver_try_iter", issue = "34931")] +#[stable(feature = "receiver_try_iter", since = "1.15.0")] pub struct TryIter<'a, T: 'a> { rx: &'a Receiver<T> } @@ -1008,7 +1008,7 @@ impl<T> Receiver<T> { /// It will return `None` if there are no more pending values or if the /// channel has hung up. The iterator will never `panic!` or block the /// user by waiting for values. - #[unstable(feature = "receiver_try_iter", issue = "34931")] + #[stable(feature = "receiver_try_iter", since = "1.15.0")] pub fn try_iter(&self) -> TryIter<T> { TryIter { rx: self } } @@ -1108,7 +1108,7 @@ impl<'a, T> Iterator for Iter<'a, T> { fn next(&mut self) -> Option<T> { self.rx.recv().ok() } } -#[unstable(feature = "receiver_try_iter", issue = "34931")] +#[stable(feature = "receiver_try_iter", since = "1.15.0")] impl<'a, T> Iterator for TryIter<'a, T> { type Item = T; diff --git a/src/libstd/sys/redox/ext/process.rs b/src/libstd/sys/redox/ext/process.rs index 1472242d3db..c59524974bf 100644 --- a/src/libstd/sys/redox/ext/process.rs +++ b/src/libstd/sys/redox/ext/process.rs @@ -56,7 +56,7 @@ pub trait CommandExt { /// When this closure is run, aspects such as the stdio file descriptors and /// working directory have successfully been changed, so output to these /// locations may not appear where intended. - #[unstable(feature = "process_exec", issue = "31398")] + #[stable(feature = "process_exec", since = "1.15.0")] fn before_exec<F>(&mut self, f: F) -> &mut process::Command where F: FnMut() -> io::Result<()> + Send + Sync + 'static; diff --git a/src/libstd/sys/unix/ext/fs.rs b/src/libstd/sys/unix/ext/fs.rs index fcfab051588..900f463fa83 100644 --- a/src/libstd/sys/unix/ext/fs.rs +++ b/src/libstd/sys/unix/ext/fs.rs @@ -21,7 +21,7 @@ use sys_common::{FromInner, AsInner, AsInnerMut}; use sys::platform::fs::MetadataExt as UnixMetadataExt; /// Unix-specific extensions to `File` -#[unstable(feature = "file_offset", issue = "35918")] +#[stable(feature = "file_offset", since = "1.15.0")] pub trait FileExt { /// Reads a number of bytes starting from a given offset. /// @@ -34,7 +34,7 @@ pub trait FileExt { /// /// Note that similar to `File::read`, it is not an error to return with a /// short read. - #[unstable(feature = "file_offset", issue = "35918")] + #[stable(feature = "file_offset", since = "1.15.0")] fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize>; /// Writes a number of bytes starting from a given offset. @@ -51,11 +51,11 @@ pub trait FileExt { /// /// Note that similar to `File::write`, it is not an error to return a /// short write. - #[unstable(feature = "file_offset", issue = "35918")] + #[stable(feature = "file_offset", since = "1.15.0")] fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize>; } -#[unstable(feature = "file_offset", issue = "35918")] +#[stable(feature = "file_offset", since = "1.15.0")] impl FileExt for fs::File { fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> { self.as_inner().read_at(buf, offset) diff --git a/src/libstd/sys/unix/ext/mod.rs b/src/libstd/sys/unix/ext/mod.rs index b2483f4e209..1be9f11b92c 100644 --- a/src/libstd/sys/unix/ext/mod.rs +++ b/src/libstd/sys/unix/ext/mod.rs @@ -50,7 +50,7 @@ pub mod prelude { pub use super::fs::{PermissionsExt, OpenOptionsExt, MetadataExt, FileTypeExt}; #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")] pub use super::fs::DirEntryExt; - #[doc(no_inline)] #[unstable(feature = "file_offset", issue = "35918")] + #[doc(no_inline)] #[stable(feature = "file_offset", since = "1.15.0")] pub use super::fs::FileExt; #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")] pub use super::thread::JoinHandleExt; diff --git a/src/libstd/sys/unix/ext/process.rs b/src/libstd/sys/unix/ext/process.rs index 3a7c59d4e6d..585dcbb9a34 100644 --- a/src/libstd/sys/unix/ext/process.rs +++ b/src/libstd/sys/unix/ext/process.rs @@ -56,7 +56,7 @@ pub trait CommandExt { /// When this closure is run, aspects such as the stdio file descriptors and /// working directory have successfully been changed, so output to these /// locations may not appear where intended. - #[unstable(feature = "process_exec", issue = "31398")] + #[stable(feature = "process_exec", since = "1.15.0")] fn before_exec<F>(&mut self, f: F) -> &mut process::Command where F: FnMut() -> io::Result<()> + Send + Sync + 'static; diff --git a/src/libstd/sys/windows/ext/fs.rs b/src/libstd/sys/windows/ext/fs.rs index 1e2b8bf38fa..7fc04ad69d6 100644 --- a/src/libstd/sys/windows/ext/fs.rs +++ b/src/libstd/sys/windows/ext/fs.rs @@ -19,7 +19,7 @@ use sys; use sys_common::{AsInnerMut, AsInner}; /// Windows-specific extensions to `File` -#[unstable(feature = "file_offset", issue = "35918")] +#[stable(feature = "file_offset", since = "1.15.0")] pub trait FileExt { /// Seeks to a given position and reads a number of bytes. /// @@ -35,7 +35,7 @@ pub trait FileExt { /// Note that similar to `File::read`, it is not an error to return with a /// short read. When returning from such a short read, the file pointer is /// still updated. - #[unstable(feature = "file_offset", issue = "35918")] + #[stable(feature = "file_offset", since = "1.15.0")] fn seek_read(&self, buf: &mut [u8], offset: u64) -> io::Result<usize>; /// Seeks to a given position and writes a number of bytes. @@ -52,11 +52,11 @@ pub trait FileExt { /// Note that similar to `File::write`, it is not an error to return a /// short write. When returning from such a short write, the file pointer /// is still updated. - #[unstable(feature = "file_offset", issue = "35918")] + #[stable(feature = "file_offset", since = "1.15.0")] fn seek_write(&self, buf: &[u8], offset: u64) -> io::Result<usize>; } -#[unstable(feature = "file_offset", issue = "35918")] +#[stable(feature = "file_offset", since = "1.15.0")] impl FileExt for fs::File { fn seek_read(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> { self.as_inner().read_at(buf, offset) diff --git a/src/libstd/sys/windows/ext/mod.rs b/src/libstd/sys/windows/ext/mod.rs index 932bb5e9564..f12e50cc923 100644 --- a/src/libstd/sys/windows/ext/mod.rs +++ b/src/libstd/sys/windows/ext/mod.rs @@ -36,6 +36,6 @@ pub mod prelude { pub use super::ffi::{OsStrExt, OsStringExt}; #[doc(no_inline)] #[stable(feature = "rust1", since = "1.0.0")] pub use super::fs::{OpenOptionsExt, MetadataExt}; - #[doc(no_inline)] #[unstable(feature = "file_offset", issue = "35918")] + #[doc(no_inline)] #[stable(feature = "file_offset", since = "1.15.0")] pub use super::fs::FileExt; } |
