Skip to content

Commit

Permalink
Import std::panic in the one place where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 5, 2021
1 parent 28514c6 commit acfe69f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/detection.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[cfg(not(is_available))]
use std::panic::{self, PanicInfo};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Once;

Expand Down Expand Up @@ -57,6 +55,8 @@ fn initialize() {
// the main thread before launching any other threads.
#[cfg(not(is_available))]
fn initialize() {
use std::panic::{self, PanicInfo};

type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static;

let null_hook: Box<PanicHook> = Box::new(|_panic_info| { /* ignore */ });
Expand Down

0 comments on commit acfe69f

Please sign in to comment.