From 0d971a63e4ff86aa416240c6684b2d7a1a4fa0c9 Mon Sep 17 00:00:00 2001 From: Ashy Date: Sun, 9 Apr 2023 15:37:34 +0100 Subject: [PATCH] Added documentation to the fields within derived read-only types (#8334) Fixes #8333 # Objective Fixes issue which causes failure to compile if using `#![deny(missing_docs)]`. ## Solution Added some very basic commenting to the generated read-only fields. honestly I feel this to be up for debate since the comments are very basic and give very little useful information but the purpose of this PR is to fix the issue at hand. --- ## Changelog Added comments to the derive macro and the projects now successfully compile. --------- Co-authored-by: lupan --- crates/bevy_ecs/macros/src/fetch.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ecs/macros/src/fetch.rs b/crates/bevy_ecs/macros/src/fetch.rs index 6f5dc575ed..93491bb531 100644 --- a/crates/bevy_ecs/macros/src/fetch.rs +++ b/crates/bevy_ecs/macros/src/fetch.rs @@ -365,7 +365,12 @@ pub fn derive_world_query_impl(input: TokenStream) -> TokenStream { #[doc = "`]."] #[automatically_derived] #visibility struct #read_only_struct_name #user_impl_generics #user_where_clauses { - #( #field_visibilities #named_field_idents: #read_only_field_types, )* + #( + #[doc = "Automatically generated read-only field for accessing `"] + #[doc = stringify!(#field_types)] + #[doc = "`."] + #field_visibilities #named_field_idents: #read_only_field_types, + )* } #readonly_state