Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions library/alloc/src/io/buffered/bufwriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,10 @@ impl<W: ?Sized + Write> BufWriter<W> {
/// # Example
///
/// ```
/// # // This test requires unwinding to work.
/// # // Disable it when unwinding isn't available.
/// # #[cfg(panic = "unwind")]
/// # fn main() {
/// use std::io::{self, BufWriter, Write};
/// use std::panic::{catch_unwind, AssertUnwindSafe};
///
Expand All @@ -508,6 +512,9 @@ impl<W: ?Sized + Write> BufWriter<W> {
/// let (recovered_writer, buffered_data) = stream.into_parts();
/// assert!(matches!(recovered_writer, PanickingWriter));
/// assert_eq!(buffered_data.unwrap_err().into_inner(), b"some data");
/// # }
/// # #[cfg(not(panic = "unwind"))]
/// # fn main() {}
/// ```
pub struct WriterPanicked {
buf: Vec<u8>,
Expand Down
Loading