diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-11 22:38:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-11 22:38:53 +0200 |
| commit | 1e99af514b68d0ff6891fa3cb6a9946c3888caef (patch) | |
| tree | 9a0e27ae2496b1dceefca827032c57c25ab763b9 /library/std/src/io/mod.rs | |
| parent | aa6a697a1c75b0aa06954136f7641706edadc2be (diff) | |
| parent | c2e5ee40b699608128654f2b67e0fafa8e1ec8dc (diff) | |
| download | rust-1e99af514b68d0ff6891fa3cb6a9946c3888caef.tar.gz rust-1e99af514b68d0ff6891fa3cb6a9946c3888caef.zip | |
Rollup merge of #122882 - Zoxc:panic-output-panic, r=Amanieu
Avoid a panic in `set_output_capture` in the default panic handler This avoid a panic in the default panic handler by not using `set_output_capture` as `OUTPUT_CAPTURE.with` may panic once `OUTPUT_CAPTURE` is dropped. A new non-panicking `try_set_output_capture` variant of `set_output_capture` is added for use in the default panic handler.
Diffstat (limited to 'library/std/src/io/mod.rs')
| -rw-r--r-- | library/std/src/io/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index fb1bf53ddc7..98973a43e1d 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -311,14 +311,14 @@ pub use self::buffered::WriterPanicked; #[unstable(feature = "raw_os_error_ty", issue = "107792")] pub use self::error::RawOsError; pub(crate) use self::stdio::attempt_print_to_stderr; -#[unstable(feature = "internal_output_capture", issue = "none")] -#[doc(no_inline, hidden)] -pub use self::stdio::set_output_capture; #[stable(feature = "is_terminal", since = "1.70.0")] pub use self::stdio::IsTerminal; #[unstable(feature = "print_internals", issue = "none")] #[doc(hidden)] pub use self::stdio::{_eprint, _print}; +#[unstable(feature = "internal_output_capture", issue = "none")] +#[doc(no_inline, hidden)] +pub use self::stdio::{set_output_capture, try_set_output_capture}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::{ buffered::{BufReader, BufWriter, IntoInnerError, LineWriter}, |
