Improve RTIC doc handling

Enable use of

```
 #![deny(missing_docs)]
```
This commit is contained in:
Henrik Tjäder 2023-01-22 00:26:09 +01:00
parent 1237f5b33b
commit f6b0d18e24
8 changed files with 48 additions and 11 deletions

View file

@ -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,)*