Skip to content

Commit

Permalink
Merge pull request #230 from dtolnay/panicinfo
Browse files Browse the repository at this point in the history
Ignore PanicInfo deprecation for now
  • Loading branch information
dtolnay authored Jul 22, 2024
2 parents 7f38154 + a867b30 commit ba45fd3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ 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;
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() {
Expand Down Expand Up @@ -597,6 +600,7 @@ fn ignore_panic<F, T>(f: F) -> ThreadResult<T>
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<PanicHook> = Box::new(|_panic_info| { /* ignore */ });
Expand Down

0 comments on commit ba45fd3

Please sign in to comment.