Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yeet
World::components_mut
>:( (bevyengine#4092)
# Objective make bevy ecs a lil bit less unsound ## Solution yeet unsound API `World::components_mut`: ```rust use bevy_ecs::prelude::*; #[derive(Component)] struct Foo(u8); #[derive(Debug, Component)] struct Bar([u8; 100]); fn main() { let mut world = World::new(); let e = world.spawn().insert(Foo(0)).id(); *world.components_mut() = Default::default(); let bar = world.entity_mut(e).remove::<Bar>().unwrap(); // oopsies reading memory copied from outside allocation dbg!(bar); } ```
- Loading branch information