Skip to content

Commit

Permalink
rust: macros: hide docs for module! public statics/fns
Browse files Browse the repository at this point in the history
So that we do not trigger `missing_docs`.

Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda committed Jul 1, 2021
1 parent db747ba commit 085cf66
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rust/macros/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ fn __build_modinfo_string_base(
format!(
"
{cfg}
#[doc(hidden)]
#[link_section = \".modinfo\"]
#[used]
pub static {variable}: [u8; {length}] = *b\"{string}\\0\";
Expand Down Expand Up @@ -599,12 +600,14 @@ pub fn module(ts: TokenStream) -> TokenStream {
// Loadable modules need to export the `{{init,cleanup}}_module` identifiers
#[cfg(MODULE)]
#[doc(hidden)]
#[no_mangle]
pub extern \"C\" fn init_module() -> kernel::c_types::c_int {{
__init()
}}
#[cfg(MODULE)]
#[doc(hidden)]
#[no_mangle]
pub extern \"C\" fn cleanup_module() {{
__exit()
Expand All @@ -614,6 +617,7 @@ pub fn module(ts: TokenStream) -> TokenStream {
// and the identifiers need to be unique
#[cfg(not(MODULE))]
#[cfg(not(CONFIG_HAVE_ARCH_PREL32_RELOCATIONS))]
#[doc(hidden)]
#[link_section = \"{initcall_section}\"]
#[used]
pub static __{name}_initcall: extern \"C\" fn() -> kernel::c_types::c_int = __{name}_init;
Expand All @@ -629,12 +633,14 @@ pub fn module(ts: TokenStream) -> TokenStream {
);
#[cfg(not(MODULE))]
#[doc(hidden)]
#[no_mangle]
pub extern \"C\" fn __{name}_init() -> kernel::c_types::c_int {{
__init()
}}
#[cfg(not(MODULE))]
#[doc(hidden)]
#[no_mangle]
pub extern \"C\" fn __{name}_exit() {{
__exit()
Expand Down

0 comments on commit 085cf66

Please sign in to comment.