diff options
author | 2023-01-22 06:57:56 +0000 | |
---|---|---|
committer | 2023-01-22 06:57:56 +0000 | |
commit | b0bda53e4e650dccb1a30718ce8dbefef6584ad0 (patch) | |
tree | 066088a7df2514af02ee0cebe6646e41efddf963 /macros/src/codegen/local_resources_struct.rs | |
parent | 86ce8919aec4623a0816b28f1adcd86db33689c8 (diff) | |
parent | 3f74f3b8459fdd451707511954a6ea3d128aabe3 (diff) | |
download | rtic-b0bda53e4e650dccb1a30718ce8dbefef6584ad0.tar.gz rtic-b0bda53e4e650dccb1a30718ce8dbefef6584ad0.tar.zst rtic-b0bda53e4e650dccb1a30718ce8dbefef6584ad0.zip |
Merge #689
689: Missing docs: Improve #[doc] generation r=korken89 a=AfoHT
Improve RTIC doc handling
Enable use of
```
#![deny(missing_docs)]
```
and makes the cargo doc output more useful
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Diffstat (limited to 'macros/src/codegen/local_resources_struct.rs')
-rw-r--r-- | macros/src/codegen/local_resources_struct.rs | 5 |
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,)* |