From da34fc26895deb263712f551da01d03dbc736575 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 26 Mar 2025 11:40:06 +1100 Subject: [PATCH] Update docs of `panic_handler` --- ebpf/aya-ebpf/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ebpf/aya-ebpf/src/lib.rs b/ebpf/aya-ebpf/src/lib.rs index dee8c735..cbefd462 100644 --- a/ebpf/aya-ebpf/src/lib.rs +++ b/ebpf/aya-ebpf/src/lib.rs @@ -136,6 +136,10 @@ pub fn check_bounds_signed(value: i64, lower: i64, upper: i64) -> bool { #[macro_export] macro_rules! prelude { () => { + /// Defines our panic handler when compiling for eBPF. + /// + /// eBPF programs are not allowed to panic, meaning this handler won't actually ever be called. + /// Because we compile with `no_std`, we need to define one. #[cfg(target_arch = "bpf")] #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! {