From b8b881f446a226d6f3c4a7db7c9174590b47dbf6 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 19 Jan 2023 13:56:59 +0100 Subject: [PATCH] Fix so deny(missing_docs) work --- examples/async-task-multiple-prios.rs | 3 +++ examples/async-task.rs | 3 +++ examples/big-struct-opt.rs | 1 + examples/binds.rs | 1 + examples/complex.rs | 1 + examples/declared_locals.rs | 1 + examples/destructure.rs | 1 + examples/extern_binds.rs | 1 + examples/extern_spawn.rs | 1 + examples/generics.rs | 1 + examples/hardware.rs | 1 + examples/idle-wfi.rs | 1 + examples/idle.rs | 1 + examples/init.rs | 1 + examples/locals.rs | 1 + examples/lock.rs | 1 + examples/multilock.rs | 1 + examples/not-sync.rs | 2 ++ examples/only-shared-access.rs | 1 + examples/peripherals-taken.rs | 3 +++ examples/preempt.rs | 1 + examples/ramfunc.rs | 2 ++ examples/resource-user-struct.rs | 1 + examples/shared.rs | 1 + examples/smallest.rs | 1 + examples/spawn.rs | 1 + examples/static.rs | 1 + examples/t-binds.rs | 1 + examples/t-cfg-resources.rs | 3 ++- examples/t-htask-main.rs | 3 +++ examples/t-idle-main.rs | 3 +++ examples/t-late-not-send.rs | 3 ++- examples/task.rs | 1 + examples/zero-prio-task.rs | 4 ++++ macros/src/codegen/local_resources_struct.rs | 2 ++ macros/src/codegen/module.rs | 1 + macros/src/codegen/shared_resources_struct.rs | 4 ++++ 37 files changed, 58 insertions(+), 2 deletions(-) diff --git a/examples/async-task-multiple-prios.rs b/examples/async-task-multiple-prios.rs index f614820cb5..5c9674d768 100644 --- a/examples/async-task-multiple-prios.rs +++ b/examples/async-task-multiple-prios.rs @@ -1,6 +1,9 @@ +//! examples/async-task-multiple-prios.rs + #![no_main] #![no_std] #![feature(type_alias_impl_trait)] +#![deny(missing_docs)] use panic_semihosting as _; diff --git a/examples/async-task.rs b/examples/async-task.rs index e1ab143258..7730c54d59 100644 --- a/examples/async-task.rs +++ b/examples/async-task.rs @@ -1,6 +1,9 @@ +//! examples/async-task.rs + #![no_main] #![no_std] #![feature(type_alias_impl_trait)] +#![deny(missing_docs)] use panic_semihosting as _; diff --git a/examples/big-struct-opt.rs b/examples/big-struct-opt.rs index 3100a0e22c..408a2dec92 100644 --- a/examples/big-struct-opt.rs +++ b/examples/big-struct-opt.rs @@ -6,6 +6,7 @@ #![no_main] #![no_std] #![feature(type_alias_impl_trait)] +#![deny(missing_docs)] use panic_semihosting as _; diff --git a/examples/binds.rs b/examples/binds.rs index 0c1ed971bd..cf078ffe9e 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -4,6 +4,7 @@ #![deny(warnings)] #![no_main] #![no_std] +#![deny(missing_docs)] use panic_semihosting as _; diff --git a/examples/complex.rs b/examples/complex.rs index ab3979244c..c1e9c6c6e0 100644 --- a/examples/complex.rs +++ b/examples/complex.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/declared_locals.rs b/examples/declared_locals.rs index 79001aa5e5..c845191024 100644 --- a/examples/declared_locals.rs +++ b/examples/declared_locals.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/destructure.rs b/examples/destructure.rs index dc5d8ef8ea..81eff3b412 100644 --- a/examples/destructure.rs +++ b/examples/destructure.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] diff --git a/examples/extern_binds.rs b/examples/extern_binds.rs index b24e7a1929..142a11d0b1 100644 --- a/examples/extern_binds.rs +++ b/examples/extern_binds.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/extern_spawn.rs b/examples/extern_spawn.rs index 8a3928d5b0..b2b95b9da4 100644 --- a/examples/extern_spawn.rs +++ b/examples/extern_spawn.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] diff --git a/examples/generics.rs b/examples/generics.rs index dfd47adfb1..2f23cce94f 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/hardware.rs b/examples/hardware.rs index 61eb6357aa..62ae0d66b6 100644 --- a/examples/hardware.rs +++ b/examples/hardware.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/idle-wfi.rs b/examples/idle-wfi.rs index a68fe84560..8134ce3e0f 100644 --- a/examples/idle-wfi.rs +++ b/examples/idle-wfi.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/idle.rs b/examples/idle.rs index 78f169777a..0c4bd044d0 100644 --- a/examples/idle.rs +++ b/examples/idle.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/init.rs b/examples/init.rs index 1e362be702..c3081bf8ed 100644 --- a/examples/init.rs +++ b/examples/init.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/locals.rs b/examples/locals.rs index 4e3b98bc86..ec3d59d8db 100644 --- a/examples/locals.rs +++ b/examples/locals.rs @@ -2,6 +2,7 @@ #![feature(type_alias_impl_trait)] #![deny(unsafe_code)] +#![deny(missing_docs)] #![deny(warnings)] #![no_main] #![no_std] diff --git a/examples/lock.rs b/examples/lock.rs index 3c1a5142a1..203ae6f47d 100644 --- a/examples/lock.rs +++ b/examples/lock.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] diff --git a/examples/multilock.rs b/examples/multilock.rs index 2eb285ea9b..6208caccd4 100644 --- a/examples/multilock.rs +++ b/examples/multilock.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] diff --git a/examples/not-sync.rs b/examples/not-sync.rs index 5d868dfb52..6d1ddaea58 100644 --- a/examples/not-sync.rs +++ b/examples/not-sync.rs @@ -2,6 +2,7 @@ // #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] @@ -9,6 +10,7 @@ use core::marker::PhantomData; use panic_semihosting as _; +/// Not sync pub struct NotSync { _0: PhantomData<*const ()>, data: u32, diff --git a/examples/only-shared-access.rs b/examples/only-shared-access.rs index 09cb23a594..1d006e636b 100644 --- a/examples/only-shared-access.rs +++ b/examples/only-shared-access.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] diff --git a/examples/peripherals-taken.rs b/examples/peripherals-taken.rs index 9b014667cb..2f710e90c3 100644 --- a/examples/peripherals-taken.rs +++ b/examples/peripherals-taken.rs @@ -1,5 +1,8 @@ +//! examples/peripherals-taken.rs + #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/preempt.rs b/examples/preempt.rs index 960fc57111..4b11907c87 100644 --- a/examples/preempt.rs +++ b/examples/preempt.rs @@ -3,6 +3,7 @@ #![no_main] #![no_std] #![feature(type_alias_impl_trait)] +#![deny(missing_docs)] use panic_semihosting as _; use rtic::app; diff --git a/examples/ramfunc.rs b/examples/ramfunc.rs index 316f6d8c53..e2e7f67bb0 100644 --- a/examples/ramfunc.rs +++ b/examples/ramfunc.rs @@ -1,9 +1,11 @@ //! examples/ramfunc.rs #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] + use panic_semihosting as _; #[rtic::app( diff --git a/examples/resource-user-struct.rs b/examples/resource-user-struct.rs index 2acbbc36fc..fcbacaea8c 100644 --- a/examples/resource-user-struct.rs +++ b/examples/resource-user-struct.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/shared.rs b/examples/shared.rs index fd31cfb28a..d0633fbd0e 100644 --- a/examples/shared.rs +++ b/examples/shared.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/smallest.rs b/examples/smallest.rs index 5071392db6..e54ae44813 100644 --- a/examples/smallest.rs +++ b/examples/smallest.rs @@ -2,6 +2,7 @@ #![no_main] #![no_std] +#![deny(missing_docs)] use panic_semihosting as _; // panic handler use rtic::app; diff --git a/examples/spawn.rs b/examples/spawn.rs index 384f0a0057..d30ecf1bb6 100644 --- a/examples/spawn.rs +++ b/examples/spawn.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] diff --git a/examples/static.rs b/examples/static.rs index 822224e373..7f656f4529 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] diff --git a/examples/t-binds.rs b/examples/t-binds.rs index 785348bc96..bdeb3917dd 100644 --- a/examples/t-binds.rs +++ b/examples/t-binds.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/t-cfg-resources.rs b/examples/t-cfg-resources.rs index 0174f33e3b..0328700957 100644 --- a/examples/t-cfg-resources.rs +++ b/examples/t-cfg-resources.rs @@ -1,7 +1,8 @@ //! [compile-pass] check that `#[cfg]` attributes applied on resources work -//! + #![no_main] #![no_std] +#![deny(missing_docs)] use panic_semihosting as _; diff --git a/examples/t-htask-main.rs b/examples/t-htask-main.rs index 0595e9fc18..8f885bc173 100644 --- a/examples/t-htask-main.rs +++ b/examples/t-htask-main.rs @@ -1,5 +1,8 @@ +//! examples/h-task-main.rs + #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/t-idle-main.rs b/examples/t-idle-main.rs index 307ccb20f8..43215cf7c5 100644 --- a/examples/t-idle-main.rs +++ b/examples/t-idle-main.rs @@ -1,5 +1,8 @@ +//! examples/t-idle-main.rs + #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] diff --git a/examples/t-late-not-send.rs b/examples/t-late-not-send.rs index 0fbf237b77..44d1d855b4 100644 --- a/examples/t-late-not-send.rs +++ b/examples/t-late-not-send.rs @@ -2,11 +2,12 @@ #![no_main] #![no_std] +#![deny(missing_docs)] use core::marker::PhantomData; - use panic_semihosting as _; +/// Not send pub struct NotSend { _0: PhantomData<*const ()>, } diff --git a/examples/task.rs b/examples/task.rs index 50287edd30..ab6a1e0e51 100644 --- a/examples/task.rs +++ b/examples/task.rs @@ -2,6 +2,7 @@ #![deny(unsafe_code)] #![deny(warnings)] +#![deny(missing_docs)] #![no_main] #![no_std] #![feature(type_alias_impl_trait)] diff --git a/examples/zero-prio-task.rs b/examples/zero-prio-task.rs index fc385092c4..c810e8fa87 100644 --- a/examples/zero-prio-task.rs +++ b/examples/zero-prio-task.rs @@ -1,10 +1,14 @@ +//! examples/zero-prio-task.rs + #![no_main] #![no_std] #![feature(type_alias_impl_trait)] +#![deny(missing_docs)] use core::marker::PhantomData; use panic_semihosting as _; +/// Does not impl send pub struct NotSend { _0: PhantomData<*const ()>, } diff --git a/macros/src/codegen/local_resources_struct.rs b/macros/src/codegen/local_resources_struct.rs index e268508bc4..100c3eb5dc 100644 --- a/macros/src/codegen/local_resources_struct.rs +++ b/macros/src/codegen/local_resources_struct.rs @@ -50,6 +50,7 @@ pub fn codegen(ctxt: Context, app: &App) -> (TokenStream2, TokenStream2) { fields.push(quote!( #(#cfgs)* + #[allow(missing_docs)] pub #name: &#lt mut #ty )); @@ -88,6 +89,7 @@ pub fn codegen(ctxt: Context, app: &App) -> (TokenStream2, TokenStream2) { let constructor = quote!( impl<'a> #ident<'a> { #[inline(always)] + #[allow(missing_docs)] pub unsafe fn new() -> Self { #ident { #(#values,)* diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs index f4c188a466..4725b9a993 100644 --- a/macros/src/codegen/module.rs +++ b/macros/src/codegen/module.rs @@ -114,6 +114,7 @@ pub fn codegen(ctxt: Context, app: &App, analysis: &Analysis) -> TokenStream2 { #(#cfgs)* impl<'a> #internal_context_name<'a> { #[inline(always)] + #[allow(missing_docs)] pub unsafe fn new(#core) -> Self { #internal_context_name { __rtic_internal_p: ::core::marker::PhantomData, diff --git a/macros/src/codegen/shared_resources_struct.rs b/macros/src/codegen/shared_resources_struct.rs index 24c93de6c1..fa6f0fcb5e 100644 --- a/macros/src/codegen/shared_resources_struct.rs +++ b/macros/src/codegen/shared_resources_struct.rs @@ -47,16 +47,19 @@ pub fn codegen(ctxt: Context, app: &App) -> (TokenStream2, TokenStream2) { fields.push(quote!( #(#cfgs)* + #[allow(missing_docs)] pub #name: &#lt #mut_ #ty )); } else if access.is_shared() { fields.push(quote!( #(#cfgs)* + #[allow(missing_docs)] pub #name: &'a #ty )); } else { fields.push(quote!( #(#cfgs)* + #[allow(missing_docs)] pub #name: shared_resources::#shared_name<'a> )); @@ -103,6 +106,7 @@ pub fn codegen(ctxt: Context, app: &App) -> (TokenStream2, TokenStream2) { let constructor = quote!( impl<'a> #ident<'a> { #[inline(always)] + #[allow(missing_docs)] pub unsafe fn new() -> Self { #ident { #(#values,)*