summaryrefslogtreecommitdiff
path: root/rust/kernel/list.rs
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2026-03-12 17:46:59 +0000
committerMiguel Ojeda <ojeda@kernel.org>2026-03-27 12:15:47 +0100
commitd58f0f146a6e3fe3c6fcf6db1e0d385414bc8713 (patch)
tree836ed14c051c22136eacb8b74827ae055fc37505 /rust/kernel/list.rs
parent9bf32bc60cb2561f8e27fea2cb24c86d5ab99997 (diff)
downloadlinux-next-d58f0f146a6e3fe3c6fcf6db1e0d385414bc8713.tar.gz
linux-next-d58f0f146a6e3fe3c6fcf6db1e0d385414bc8713.zip
rust: list: hide macros from top-level kernel doc
Due to Rust macro scoping rules, all macros defined in a crate using `#[macro_export]` end up in the top-level. For the list macros, we re-export them inside the list module, and expect users to use `kernel::list::macro_name!()`. Use `#[doc(hidden)]` on the macro definition, and use `#[doc(inline)]` on the re-export to make the macro appear to be defined at module-level inside documentation. The other exported types are already automatically `#[doc(inline)]` because they are defined in a non-public module, so there is no need to split the macro re-exports out. Signed-off-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260312174700.4016015-1-gary@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/list.rs')
-rw-r--r--rust/kernel/list.rs22
1 files changed, 19 insertions, 3 deletions
diff --git a/rust/kernel/list.rs b/rust/kernel/list.rs
index 8349ff32fc37..406e3a028c55 100644
--- a/rust/kernel/list.rs
+++ b/rust/kernel/list.rs
@@ -12,15 +12,31 @@ use core::ptr;
use pin_init::PinInit;
mod impl_list_item_mod;
+#[doc(inline)]
pub use self::impl_list_item_mod::{
- impl_has_list_links, impl_has_list_links_self_ptr, impl_list_item, HasListLinks, HasSelfPtr,
+ impl_has_list_links,
+ impl_has_list_links_self_ptr,
+ impl_list_item,
+ HasListLinks,
+ HasSelfPtr, //
};
mod arc;
-pub use self::arc::{impl_list_arc_safe, AtomicTracker, ListArc, ListArcSafe, TryNewListArc};
+#[doc(inline)]
+pub use self::arc::{
+ impl_list_arc_safe,
+ AtomicTracker,
+ ListArc,
+ ListArcSafe,
+ TryNewListArc, //
+};
mod arc_field;
-pub use self::arc_field::{define_list_arc_field_getter, ListArcField};
+#[doc(inline)]
+pub use self::arc_field::{
+ define_list_arc_field_getter,
+ ListArcField, //
+};
/// A linked list.
///