Skip to content

Commit 8c4fe8d

Browse files
committed
Don't set panic handlers when testing.
1 parent 41fd137 commit 8c4fe8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ fn get_api() -> &'static Api {
322322
unsafe { ptr.as_ref().unwrap() }
323323
}
324324

325-
#[cfg(feature = "fancy-panic")]
325+
#[cfg(all(feature = "fancy-panic", not(test)))]
326326
#[inline(never)]
327327
#[panic_handler]
328328
fn panic(info: &core::panic::PanicInfo) -> ! {
@@ -332,7 +332,7 @@ fn panic(info: &core::panic::PanicInfo) -> ! {
332332
loop {}
333333
}
334334

335-
#[cfg(not(feature = "fancy-panic"))]
335+
#[cfg(all(not(feature = "fancy-panic"), not(test)))]
336336
#[inline(never)]
337337
#[panic_handler]
338338
fn panic(_info: &core::panic::PanicInfo) -> ! {

0 commit comments

Comments
 (0)