Skip to content

Commit

Permalink
Added documentation to the fields within derived read-only types (#8334)
Browse files Browse the repository at this point in the history
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 <kallll5@hotmail.com>
  • Loading branch information
LoopyAshy and lupan authored Apr 9, 2023
1 parent e931225 commit 0d971a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/bevy_ecs/macros/src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d971a6

Please sign in to comment.