Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix field visibility for read-only WorldQuery types #8163

Merged
merged 3 commits into from Mar 22, 2023

Conversation

JoJoJet
Copy link
Member

@JoJoJet JoJoJet commented Mar 22, 2023

Objective

When using the #[derive(WorldQuery)] macro, the ReadOnly struct generated has default (private) visibility for each field, regardless of the visibility of the original field.

Solution

For each field of a read-only WorldQuery variant, use the visibility of the corresponding field defined on the original struct.

@JoJoJet JoJoJet added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events labels Mar 22, 2023
@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Mar 22, 2023
@james7132 james7132 added this to the 0.10.1 milestone Mar 22, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 22, 2023
@alice-i-cecile alice-i-cecile merged commit ce33354 into bevyengine:main Mar 22, 2023
24 checks passed
@JoJoJet JoJoJet deleted the query-read-only-pub branch March 22, 2023 18:51
mockersf pushed a commit that referenced this pull request Mar 27, 2023
When using the `#[derive(WorldQuery)]` macro, the `ReadOnly` struct
generated has default (private) visibility for each field, regardless of
the visibility of the original field.

For each field of a read-only `WorldQuery` variant, use the visibility
of the associated field defined on the original struct.
UkoeHB pushed a commit to UkoeHB/bevy that referenced this pull request Sep 10, 2023
When using the `#[derive(WorldQuery)]` macro, the `ReadOnly` struct
generated has default (private) visibility for each field, regardless of
the visibility of the original field.

For each field of a read-only `WorldQuery` variant, use the visibility
of the associated field defined on the original struct.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants