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

[Merged by Bors] - Make derived SystemParam readonly if possible #4650

Closed
wants to merge 3 commits into from

Conversation

DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented May 3, 2022

Required for #4402.

Objective

  • derived SystemParam implementations were never ReadOnlySystemParamFetch
  • We want them to be, e.g. for EventReader

Solution

  • If possible, 'forward' the impl of ReadOnlySystemParamFetch.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label May 3, 2022
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use and removed S-Needs-Triage This issue needs to be labelled A-ECS Entities, components, systems, and events labels May 3, 2022
@DJMcNab DJMcNab changed the title Make SystemParam readonly if possible Make derived SystemParam readonly if possible May 4, 2022
@DJMcNab DJMcNab 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 May 6, 2022
Copy link
Member

@BoxyUwU BoxyUwU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably deserves a compile fail test that deriving system param on something like Query<'a, 'b, &'static mut Foo> doesnt get ReadOnlySystemParamFetch

@DJMcNab
Copy link
Member Author

DJMcNab commented May 7, 2022

All this change does is pass through an existing implementation, and the safety comment expresses this.
There's not really any way for it to go wrong, unless another implementation is also wrong.

(Also I don't know where that compile fail test would go)

@BoxyUwU
Copy link
Member

BoxyUwU commented May 7, 2022

crates/bevy_ecs_compile_fail_tests/tests/ui we have some in there for derive(WorldQuery)

@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request May 9, 2022
Required for #4402.

# Objective

- derived `SystemParam` implementations were never `ReadOnlySystemParamFetch`
- We want them to be, e.g. for `EventReader`

## Solution

- If possible, 'forward' the impl of `ReadOnlySystemParamFetch`.
@bors
Copy link
Contributor

bors bot commented May 9, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request May 9, 2022
Required for #4402.

# Objective

- derived `SystemParam` implementations were never `ReadOnlySystemParamFetch`
- We want them to be, e.g. for `EventReader`

## Solution

- If possible, 'forward' the impl of `ReadOnlySystemParamFetch`.
@bors
Copy link
Contributor

bors bot commented May 9, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request May 9, 2022
Required for #4402.

# Objective

- derived `SystemParam` implementations were never `ReadOnlySystemParamFetch`
- We want them to be, e.g. for `EventReader`

## Solution

- If possible, 'forward' the impl of `ReadOnlySystemParamFetch`.
@bors
Copy link
Contributor

bors bot commented May 9, 2022

Build failed (retrying...):

@bors
Copy link
Contributor

bors bot commented May 9, 2022

Canceled.

@alice-i-cecile
Copy link
Member

@DJMcNab can you rebase? It looks like the changes in #3863 broke this.

@DJMcNab
Copy link
Member Author

DJMcNab commented May 9, 2022

I think I'm already rebased past that PR?

At least I think that's why I rebased most recently

@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request May 9, 2022
Required for #4402.

# Objective

- derived `SystemParam` implementations were never `ReadOnlySystemParamFetch`
- We want them to be, e.g. for `EventReader`

## Solution

- If possible, 'forward' the impl of `ReadOnlySystemParamFetch`.
@bors bors bot changed the title Make derived SystemParam readonly if possible [Merged by Bors] - Make derived SystemParam readonly if possible May 9, 2022
@bors bors bot closed this May 9, 2022
@DJMcNab DJMcNab deleted the bookworm branch May 9, 2022 16:23
robtfm pushed a commit to robtfm/bevy that referenced this pull request May 10, 2022
Required for bevyengine#4402.

# Objective

- derived `SystemParam` implementations were never `ReadOnlySystemParamFetch`
- We want them to be, e.g. for `EventReader`

## Solution

- If possible, 'forward' the impl of `ReadOnlySystemParamFetch`.
exjam pushed a commit to exjam/bevy that referenced this pull request May 22, 2022
Required for bevyengine#4402.

# Objective

- derived `SystemParam` implementations were never `ReadOnlySystemParamFetch`
- We want them to be, e.g. for `EventReader`

## Solution

- If possible, 'forward' the impl of `ReadOnlySystemParamFetch`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
Required for bevyengine#4402.

# Objective

- derived `SystemParam` implementations were never `ReadOnlySystemParamFetch`
- We want them to be, e.g. for `EventReader`

## Solution

- If possible, 'forward' the impl of `ReadOnlySystemParamFetch`.
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-Usability A simple quality-of-life change that makes Bevy easier to use 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

5 participants