From ffa931552ea60e3dd8d0165a1a9c97bf36e23675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=C2=A0Decina?= Date: Sun, 17 Oct 2021 00:11:27 +0000 Subject: [PATCH] ebpf: use core::hint::unreachable_unchecked() unreachable!() can panic when debug assertions is on, and we don't want that inside a panic handler --- {{project-name}}-ebpf/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{project-name}}-ebpf/src/main.rs b/{{project-name}}-ebpf/src/main.rs index 2c8cd30..69185ce 100644 --- a/{{project-name}}-ebpf/src/main.rs +++ b/{{project-name}}-ebpf/src/main.rs @@ -181,5 +181,5 @@ unsafe fn try_{{crate_name}}(_ctx: TracePointContext) -> Result { #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { - unreachable!() + unsafe { core::hint::unreachable_unchecked() } } \ No newline at end of file