Use dyn Trait syntax
diff --git a/src/lib.rs b/src/lib.rs
index 190916d..9ad655d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -88,7 +88,7 @@
 #![doc(html_root_url = "https://docs.rs/proc-macro2/0.4.30")]
 #![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
 #![cfg_attr(super_unstable, feature(proc_macro_raw_ident, proc_macro_def_site))]
-#![allow(bare_trait_objects, ellipsis_inclusive_range_patterns, unknown_lints)]
+#![allow(ellipsis_inclusive_range_patterns, unknown_lints)]
 
 #[cfg(use_proc_macro)]
 extern crate proc_macro;
diff --git a/src/wrapper.rs b/src/wrapper.rs
index 36b75eb..69e8e86 100644
--- a/src/wrapper.rs
+++ b/src/wrapper.rs
@@ -60,7 +60,7 @@
     // not occur, they need to call e.g. `proc_macro2::Span::call_site()` from
     // the main thread before launching any other threads.
     INIT.call_once(|| {
-        type PanicHook = Fn(&PanicInfo) + Sync + Send + 'static;
+        type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static;
 
         let null_hook: Box<PanicHook> = Box::new(|_panic_info| { /* ignore */ });
         let sanity_check = &*null_hook as *const PanicHook;