Merge pull request #6792 from cakebaker/uucore_allow_deprecated

uucore: allow use of deprecated `PanicInfo`
This commit is contained in:
Sylvestre Ledru
2024-10-18 08:29:15 +02:00
committed by GitHub
+4
View File
@@ -14,9 +14,13 @@
//! ```
//!
use std::panic;
// TODO: use PanicHookInfo when we have a MSRV of 1.81
#[allow(deprecated)]
use std::panic::PanicInfo;
/// Decide whether a panic was caused by a broken pipe (SIGPIPE) error.
// TODO: use PanicHookInfo when we have a MSRV of 1.81
#[allow(deprecated)]
fn is_broken_pipe(info: &PanicInfo) -> bool {
if let Some(res) = info.payload().downcast_ref::<String>() {
if res.contains("BrokenPipe") || res.contains("Broken pipe") {