From ecf4c5291f48b6aab1570a76f6732d8d3458255e Mon Sep 17 00:00:00 2001 From: radiish Date: Sun, 5 Feb 2023 09:14:13 +0000 Subject: [PATCH] readd safety comment --- crates/bevy_asset/src/reflect.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/bevy_asset/src/reflect.rs b/crates/bevy_asset/src/reflect.rs index 9656664faf47ca..61857e4e524a0d 100644 --- a/crates/bevy_asset/src/reflect.rs +++ b/crates/bevy_asset/src/reflect.rs @@ -18,6 +18,9 @@ pub struct ReflectAsset { assets_resource_type_id: TypeId, get: fn(&World, HandleUntyped) -> Option<&dyn PartialReflect>, + // SAFETY: + // - may only be called with a [`IteriorMutableWorld`] which can be used to access the corresponding `Assets` resource mutably + // - may only be used to access **at most one** access at once get_unchecked_mut: unsafe fn(UnsafeWorldCell<'_>, HandleUntyped) -> Option<&mut dyn PartialReflect>, add: fn(&mut World, &dyn PartialReflect) -> HandleUntyped,