diff options
| author | Léo Lanteri Thauvin <leseulartichaut@gmail.com> | 2021-08-25 15:49:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-25 15:49:01 +0200 |
| commit | 3eee91b40349fc4749026ca353d91d60d2c85c28 (patch) | |
| tree | 7d4904895dd76676614d8c4929ee431b5bfd775c | |
| parent | 82ecb0f412be53affb240cd1b356488218d1adca (diff) | |
| parent | db13636f036db4b7988fafd2288dc73ce46a1e53 (diff) | |
| download | rust-3eee91b40349fc4749026ca353d91d60d2c85c28.tar.gz rust-3eee91b40349fc4749026ca353d91d60d2c85c28.zip | |
Rollup merge of #88299 - ijackson:bufwriter, r=Mark-Simulacrum
Stabilise BufWriter::into_parts The FCP for this has already completed, in #80690. This was just blocked on #85901 (which changed the name), which is now merged. The original stabilisation MR was #84770 but that has a lot of noise in it, and I also accidentally deleted the branch while trying to tidy up. So here is a new MR. Sorry for the noise. Closes #80690
| -rw-r--r-- | library/std/src/io/buffered/bufwriter.rs | 14 | ||||
| -rw-r--r-- | library/std/src/io/buffered/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/io/mod.rs | 2 |
3 files changed, 8 insertions, 10 deletions
diff --git a/library/std/src/io/buffered/bufwriter.rs b/library/std/src/io/buffered/bufwriter.rs index 9da5fbff9cf..df60af7c36a 100644 --- a/library/std/src/io/buffered/bufwriter.rs +++ b/library/std/src/io/buffered/bufwriter.rs @@ -323,7 +323,6 @@ impl<W: Write> BufWriter<W> { /// # Examples /// /// ``` - /// #![feature(bufwriter_into_parts)] /// use std::io::{BufWriter, Write}; /// /// let mut buffer = [0u8; 10]; @@ -334,7 +333,7 @@ impl<W: Write> BufWriter<W> { /// assert_eq!(recovered_writer.len(), 0); /// assert_eq!(&buffered_data.unwrap(), b"ata"); /// ``` - #[unstable(feature = "bufwriter_into_parts", issue = "80690")] + #[stable(feature = "bufwriter_into_parts", since = "1.56.0")] pub fn into_parts(mut self) -> (W, Result<Vec<u8>, WriterPanicked>) { let buf = mem::take(&mut self.buf); let buf = if !self.panicked { Ok(buf) } else { Err(WriterPanicked { buf }) }; @@ -444,14 +443,13 @@ impl<W: Write> BufWriter<W> { } } -#[unstable(feature = "bufwriter_into_parts", issue = "80690")] +#[stable(feature = "bufwriter_into_parts", since = "1.56.0")] /// Error returned for the buffered data from `BufWriter::into_parts`, when the underlying /// writer has previously panicked. Contains the (possibly partly written) buffered data. /// /// # Example /// /// ``` -/// #![feature(bufwriter_into_parts)] /// use std::io::{self, BufWriter, Write}; /// use std::panic::{catch_unwind, AssertUnwindSafe}; /// @@ -478,7 +476,7 @@ pub struct WriterPanicked { impl WriterPanicked { /// Returns the perhaps-unwritten data. Some of this data may have been written by the /// panicking call(s) to the underlying writer, so simply writing it again is not a good idea. - #[unstable(feature = "bufwriter_into_parts", issue = "80690")] + #[stable(feature = "bufwriter_into_parts", since = "1.56.0")] pub fn into_inner(self) -> Vec<u8> { self.buf } @@ -487,7 +485,7 @@ impl WriterPanicked { "BufWriter inner writer panicked, what data remains unwritten is not known"; } -#[unstable(feature = "bufwriter_into_parts", issue = "80690")] +#[stable(feature = "bufwriter_into_parts", since = "1.56.0")] impl error::Error for WriterPanicked { #[allow(deprecated, deprecated_in_future)] fn description(&self) -> &str { @@ -495,14 +493,14 @@ impl error::Error for WriterPanicked { } } -#[unstable(feature = "bufwriter_into_parts", issue = "80690")] +#[stable(feature = "bufwriter_into_parts", since = "1.56.0")] impl fmt::Display for WriterPanicked { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", Self::DESCRIPTION) } } -#[unstable(feature = "bufwriter_into_parts", issue = "80690")] +#[stable(feature = "bufwriter_into_parts", since = "1.56.0")] impl fmt::Debug for WriterPanicked { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("WriterPanicked") diff --git a/library/std/src/io/buffered/mod.rs b/library/std/src/io/buffered/mod.rs index 8cfffc2fd35..179bdf7fe55 100644 --- a/library/std/src/io/buffered/mod.rs +++ b/library/std/src/io/buffered/mod.rs @@ -14,7 +14,7 @@ use crate::io::Error; pub use bufreader::BufReader; pub use bufwriter::BufWriter; -#[unstable(feature = "bufwriter_into_parts", issue = "80690")] +#[stable(feature = "bufwriter_into_parts", since = "1.56.0")] pub use bufwriter::WriterPanicked; pub use linewriter::LineWriter; use linewritershim::LineWriterShim; diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 28254fea0d3..e8466fa06b8 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -264,7 +264,7 @@ use crate::sys_common::memchr; #[stable(feature = "rust1", since = "1.0.0")] pub use self::buffered::IntoInnerError; -#[unstable(feature = "bufwriter_into_parts", issue = "80690")] +#[stable(feature = "bufwriter_into_parts", since = "1.56.0")] pub use self::buffered::WriterPanicked; #[stable(feature = "rust1", since = "1.0.0")] pub use self::buffered::{BufReader, BufWriter, LineWriter}; |
