diff --git a/bpf/aya-bpf-macros/src/lib.rs b/bpf/aya-bpf-macros/src/lib.rs index 4ae01f83..61d49bae 100644 --- a/bpf/aya-bpf-macros/src/lib.rs +++ b/bpf/aya-bpf-macros/src/lib.rs @@ -358,18 +358,20 @@ pub fn socket_filter(attrs: TokenStream, item: TokenStream) -> TokenStream { /// # Examples /// /// ```no_run +/// # #![allow(non_camel_case_types)] /// use aya_bpf::{macros::fentry, programs::FEntryContext}; -/// use vmlinux::{filename, path}; +/// # type filename = u32; +/// # type path = u32; /// /// #[fentry(name = "filename_lookup")] /// fn filename_lookup(ctx: FEntryContext) -> i32 { -/// match { try_filename_lookup(ctx) } { +/// match unsafe { try_filename_lookup(ctx) } { /// Ok(ret) => ret, /// Err(ret) => ret, /// } /// } /// -/// unsafe fn try_filename_lookup(ctx: FEntryContext) -> Result { +/// unsafe fn try_filename_lookup(ctx: FEntryContext) -> Result { /// let _f: *const filename = ctx.arg(1); /// let _p: *const path = ctx.arg(3); /// @@ -400,18 +402,20 @@ pub fn fentry(attrs: TokenStream, item: TokenStream) -> TokenStream { /// # Examples /// /// ```no_run +/// # #![allow(non_camel_case_types)] /// use aya_bpf::{macros::fexit, programs::FExitContext}; -/// use vmlinux::{filename, path}; +/// # type filename = u32; +/// # type path = u32; /// /// #[fexit(name = "filename_lookup")] /// fn filename_lookup(ctx: FExitContext) -> i32 { -/// match { try_filename_lookup(ctx) } { +/// match unsafe { try_filename_lookup(ctx) } { /// Ok(ret) => ret, /// Err(ret) => ret, /// } /// } /// -/// unsafe fn try_filename_lookup(ctx: FExitContext) -> Result { +/// unsafe fn try_filename_lookup(ctx: FExitContext) -> Result { /// let _f: *const filename = ctx.arg(1); /// let _p: *const path = ctx.arg(3); ///