Skip to content

Commit db13636

Browse files
committed
Stabilise BufWriter::into_parts
Signed-off-by: Ian Jackson <[email protected]>
1 parent 47ab5f7 commit db13636

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

library/std/src/io/buffered/bufwriter.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ impl<W: Write> BufWriter<W> {
323323
/// # Examples
324324
///
325325
/// ```
326-
/// #![feature(bufwriter_into_parts)]
327326
/// use std::io::{BufWriter, Write};
328327
///
329328
/// let mut buffer = [0u8; 10];
@@ -334,7 +333,7 @@ impl<W: Write> BufWriter<W> {
334333
/// assert_eq!(recovered_writer.len(), 0);
335334
/// assert_eq!(&buffered_data.unwrap(), b"ata");
336335
/// ```
337-
#[unstable(feature = "bufwriter_into_parts", issue = "80690")]
336+
#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
338337
pub fn into_parts(mut self) -> (W, Result<Vec<u8>, WriterPanicked>) {
339338
let buf = mem::take(&mut self.buf);
340339
let buf = if !self.panicked { Ok(buf) } else { Err(WriterPanicked { buf }) };
@@ -444,14 +443,13 @@ impl<W: Write> BufWriter<W> {
444443
}
445444
}
446445

447-
#[unstable(feature = "bufwriter_into_parts", issue = "80690")]
446+
#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
448447
/// Error returned for the buffered data from `BufWriter::into_parts`, when the underlying
449448
/// writer has previously panicked. Contains the (possibly partly written) buffered data.
450449
///
451450
/// # Example
452451
///
453452
/// ```
454-
/// #![feature(bufwriter_into_parts)]
455453
/// use std::io::{self, BufWriter, Write};
456454
/// use std::panic::{catch_unwind, AssertUnwindSafe};
457455
///
@@ -478,7 +476,7 @@ pub struct WriterPanicked {
478476
impl WriterPanicked {
479477
/// Returns the perhaps-unwritten data. Some of this data may have been written by the
480478
/// panicking call(s) to the underlying writer, so simply writing it again is not a good idea.
481-
#[unstable(feature = "bufwriter_into_parts", issue = "80690")]
479+
#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
482480
pub fn into_inner(self) -> Vec<u8> {
483481
self.buf
484482
}
@@ -487,22 +485,22 @@ impl WriterPanicked {
487485
"BufWriter inner writer panicked, what data remains unwritten is not known";
488486
}
489487

490-
#[unstable(feature = "bufwriter_into_parts", issue = "80690")]
488+
#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
491489
impl error::Error for WriterPanicked {
492490
#[allow(deprecated, deprecated_in_future)]
493491
fn description(&self) -> &str {
494492
Self::DESCRIPTION
495493
}
496494
}
497495

498-
#[unstable(feature = "bufwriter_into_parts", issue = "80690")]
496+
#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
499497
impl fmt::Display for WriterPanicked {
500498
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
501499
write!(f, "{}", Self::DESCRIPTION)
502500
}
503501
}
504502

505-
#[unstable(feature = "bufwriter_into_parts", issue = "80690")]
503+
#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
506504
impl fmt::Debug for WriterPanicked {
507505
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
508506
f.debug_struct("WriterPanicked")

library/std/src/io/buffered/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::io::Error;
1414

1515
pub use bufreader::BufReader;
1616
pub use bufwriter::BufWriter;
17-
#[unstable(feature = "bufwriter_into_parts", issue = "80690")]
17+
#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
1818
pub use bufwriter::WriterPanicked;
1919
pub use linewriter::LineWriter;
2020
use linewritershim::LineWriterShim;

library/std/src/io/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ use crate::sys_common::memchr;
264264

265265
#[stable(feature = "rust1", since = "1.0.0")]
266266
pub use self::buffered::IntoInnerError;
267-
#[unstable(feature = "bufwriter_into_parts", issue = "80690")]
267+
#[stable(feature = "bufwriter_into_parts", since = "1.56.0")]
268268
pub use self::buffered::WriterPanicked;
269269
#[stable(feature = "rust1", since = "1.0.0")]
270270
pub use self::buffered::{BufReader, BufWriter, LineWriter};

0 commit comments

Comments
 (0)