aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/local_resources_struct.rs
diff options
context:
space:
mode:
authorGravatar Henrik Tjäder <henrik@tjaders.com> 2023-01-22 00:26:09 +0100
committerGravatar Henrik Tjäder <henrik@tjaders.com> 2023-01-22 00:26:23 +0100
commitf6b0d18e24d49e5ecdcd18393c9c3109441a83e9 (patch)
tree1bbe38ce970844620b49ac2599fd7b21f010622f /macros/src/codegen/local_resources_struct.rs
parent1237f5b33b5ad61e94acb7f93255cb97bfb8ead6 (diff)
downloadrtic-f6b0d18e24d49e5ecdcd18393c9c3109441a83e9.tar.gz
rtic-f6b0d18e24d49e5ecdcd18393c9c3109441a83e9.tar.zst
rtic-f6b0d18e24d49e5ecdcd18393c9c3109441a83e9.zip
Improve RTIC doc handling
Enable use of ``` #![deny(missing_docs)] ```
Diffstat (limited to 'macros/src/codegen/local_resources_struct.rs')
-rw-r--r--macros/src/codegen/local_resources_struct.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/macros/src/codegen/local_resources_struct.rs b/macros/src/codegen/local_resources_struct.rs
index b7eae3f9..74bdbf8b 100644
--- a/macros/src/codegen/local_resources_struct.rs
+++ b/macros/src/codegen/local_resources_struct.rs
@@ -49,7 +49,9 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2,
util::declared_static_local_resource_ident(name, &task_name)
};
+ let local_resource_doc = format!(" Local resource `{name}`");
fields.push(quote!(
+ #[doc = #local_resource_doc]
#(#cfgs)*
pub #name: &#lt mut #ty
));
@@ -82,7 +84,7 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2,
}
}
- let doc = format!("Local resources `{}` has access to", ctxt.ident(app));
+ let doc = format!(" Local resources `{}` has access to", ctxt.ident(app));
let ident = util::local_resources_ident(ctxt, app);
let item = quote!(
#[allow(non_snake_case)]
@@ -96,6 +98,7 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2,
let constructor = quote!(
impl<#lt> #ident<#lt> {
#[inline(always)]
+ #[doc(hidden)]
pub unsafe fn new() -> Self {
#ident {
#(#values,)*