From a867b30bcd05bc9b84158bc57bd1f2cc33958a8f Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 21 Jul 2024 19:35:11 -0700 Subject: [PATCH] Ignore PanicInfo deprecation for now We'll be able to use PanicHookInfo after dropping support for Rust 1.81. --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index de6323c..3f0bba2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,7 +41,7 @@ use std::error::Error as StdError; use std::ffi::{OsStr, OsString}; use std::io::{self, BufRead, IsTerminal, Write}; use std::iter; -use std::panic::{self, PanicInfo, UnwindSafe}; +use std::panic::{self, UnwindSafe}; use std::path::{Path, PathBuf}; use std::process::{self, Command, Stdio}; use std::ptr; @@ -49,6 +49,9 @@ use std::str; use std::thread::Result as ThreadResult; use termcolor::{Color::Green, ColorChoice, ColorSpec, StandardStream, WriteColor}; +#[allow(deprecated)] // https://github.com/dtolnay/cargo-expand/issues/229 +use std::panic::PanicInfo; + cargo_subcommand_metadata::description!("Show result of macro expansion"); fn main() { @@ -597,6 +600,7 @@ fn ignore_panic(f: F) -> ThreadResult where F: UnwindSafe + FnOnce() -> T, { + #[allow(deprecated)] // https://github.com/dtolnay/cargo-expand/issues/229 type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static; let null_hook: Box = Box::new(|_panic_info| { /* ignore */ });