@@ -70,7 +70,9 @@ impl<'w> EntityRef<'w> {
70
70
/// Gets an immutable reference to the component of type `T` associated with
71
71
/// this entity without ensuring there are no unique borrows active and without
72
72
/// ensuring that the returned reference will stay valid.
73
+ ///
73
74
/// # Safety
75
+ ///
74
76
/// - The returned reference must never alias a mutable borrow of this component.
75
77
/// - The returned reference must not be used after this component is moved which
76
78
/// may happen from **any** `insert_component`, `remove_component` or `despawn`
@@ -85,7 +87,9 @@ impl<'w> EntityRef<'w> {
85
87
/// Gets a mutable reference to the component of type `T` associated with
86
88
/// this entity without ensuring there are no other borrows active and without
87
89
/// ensuring that the returned reference will stay valid.
90
+ ///
88
91
/// # Safety
92
+ ///
89
93
/// - The returned reference must never alias a mutable borrow of this component.
90
94
/// - The returned reference must not be used after this component is moved which
91
95
/// may happen from **any** `insert_component`, `remove_component` or `despawn`
@@ -176,7 +180,9 @@ impl<'w> EntityMut<'w> {
176
180
/// Gets an immutable reference to the component of type `T` associated with
177
181
/// this entity without ensuring there are no unique borrows active and without
178
182
/// ensuring that the returned reference will stay valid.
183
+ ///
179
184
/// # Safety
185
+ ///
180
186
/// - The returned reference must never alias a mutable borrow of this component.
181
187
/// - The returned reference must not be used after this component is moved which
182
188
/// may happen from **any** `insert_component`, `remove_component` or `despawn`
@@ -191,7 +197,9 @@ impl<'w> EntityMut<'w> {
191
197
/// Gets a mutable reference to the component of type `T` associated with
192
198
/// this entity without ensuring there are no other borrows active and without
193
199
/// ensuring that the returned reference will stay valid.
200
+ ///
194
201
/// # Safety
202
+ ///
195
203
/// - The returned reference must never alias a mutable borrow of this component.
196
204
/// - The returned reference must not be used after this component is moved which
197
205
/// may happen from **any** `insert_component`, `remove_component` or `despawn`
0 commit comments