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] - REMOVE unsound lifetime annotations on EntityMut #4096

Closed

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Mar 4, 2022

Fixes #3408
#3001 also solves this but I dont see it getting merged any time soon so...

Objective

make bevy ecs a lil bit less unsound

Solution

make EntityMut::get_component_mut return borrows from self instead of 'w

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Mar 4, 2022
@BoxyUwU BoxyUwU added the A-ECS Entities, components, systems, and events label Mar 4, 2022
@alice-i-cecile alice-i-cecile added P-High This is particularly urgent, and deserves immediate attention C-Bug An unexpected or incorrect behavior and removed S-Needs-Triage This issue needs to be labelled labels Mar 4, 2022
@BoxyUwU BoxyUwU force-pushed the port_ptrification_soundnes_fix branch from a1cd173 to 7e4eacd Compare March 4, 2022 04:08
@BoxyUwU BoxyUwU changed the title yeet 'w lifetime >:( yeet unsound lifetime annotations on Entity(Ref/Mut) >:( Mar 17, 2022
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

The UB is clear, and upon examining this more closely, the 'w lifetime is clearly incorrect. I've left some comments to improve the docs and safety comments.

@BoxyUwU BoxyUwU force-pushed the port_ptrification_soundnes_fix branch from 407a2de to 45da4b4 Compare March 17, 2022 22:07
@alice-i-cecile
Copy link
Member

@BoxyUwU can you resolve conversations now? :)

@BoxyUwU BoxyUwU 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 18, 2022
@BoxyUwU BoxyUwU changed the title yeet unsound lifetime annotations on Entity(Ref/Mut) >:( REMOVE unsound lifetime annotations on Entity(Ref/Mut) Mar 22, 2022
@alice-i-cecile alice-i-cecile added this to the Bevy 0.7 milestone Mar 23, 2022
@BoxyUwU BoxyUwU changed the title REMOVE unsound lifetime annotations on Entity(Ref/Mut) REMOVE unsound lifetime annotations on EntityMut Mar 28, 2022
@BoxyUwU BoxyUwU force-pushed the port_ptrification_soundnes_fix branch from e49da1f to 7203f9e Compare March 31, 2022 19:32
@BoxyUwU BoxyUwU force-pushed the port_ptrification_soundnes_fix branch from 7203f9e to 05f0168 Compare April 3, 2022 09:31
@cart
Copy link
Member

cart commented Apr 4, 2022

bors r+

bors bot pushed a commit that referenced this pull request Apr 4, 2022
Fixes #3408
#3001 also solves this but I dont see it getting merged any time soon so...
# Objective
make bevy ecs a lil bit less unsound

## Solution
make `EntityMut::get_component_mut` return borrows from self instead of `'w`
@bors bors bot changed the title REMOVE unsound lifetime annotations on EntityMut [Merged by Bors] - REMOVE unsound lifetime annotations on EntityMut Apr 4, 2022
@bors bors bot closed this Apr 4, 2022
aevyrie pushed a commit to aevyrie/bevy that referenced this pull request Jun 7, 2022
Fixes bevyengine#3408
bevyengine#3001 also solves this but I dont see it getting merged any time soon so...
# Objective
make bevy ecs a lil bit less unsound

## Solution
make `EntityMut::get_component_mut` return borrows from self instead of `'w`
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
Fixes bevyengine#3408
bevyengine#3001 also solves this but I dont see it getting merged any time soon so...
# Objective
make bevy ecs a lil bit less unsound

## Solution
make `EntityMut::get_component_mut` return borrows from self instead of `'w`
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 P-High This is particularly urgent, and deserves immediate attention S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

World entity access is not sound
5 participants