Skip to content

Derive Clone on Parent and Children#15574

Closed
atornity wants to merge 2 commits intobevyengine:mainfrom
atornity:parent-clone
Closed

Derive Clone on Parent and Children#15574
atornity wants to merge 2 commits intobevyengine:mainfrom
atornity:parent-clone

Conversation

@atornity
Copy link
Copy Markdown
Contributor

@atornity atornity commented Oct 1, 2024

Objective

Parent and Children should be Cloneble.

Solution

Derive Clone on Parent and Children.

@alice-i-cecile alice-i-cecile added the X-Needs-SME This type of work requires an SME to approve it. label Oct 1, 2024
@MrGVSV
Copy link
Copy Markdown
Member

MrGVSV commented Oct 1, 2024

Wouldn't this allow users to accidentally put these components into invalid states?

For example, cloning Parent and inserting it onto an entity that isn't one of its children.

@alice-i-cecile
Copy link
Copy Markdown
Member

This enables UB via mem swap shenanigans breaking the invariants relied on during unsafe transform propagation. So we can't merge this.

@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Hierarchy labels Oct 1, 2024
@atornity atornity deleted the parent-clone branch October 1, 2024 20:04
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events and removed A-Hierarchy labels Jan 28, 2025
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 targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy X-Needs-SME This type of work requires an SME to approve it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants