@@ -218,11 +218,14 @@ pub unsafe trait SystemParam: Sized {
218
218
fn queue ( state : & mut Self :: State , system_meta : & SystemMeta , world : DeferredWorld ) { }
219
219
220
220
/// Validates that the data can be acquired by [`get_param`](SystemParam::get_param).
221
- /// For systems this means they won't be executed.
221
+ /// The [`world`](UnsafeWorldCell) can only be used to read param's data
222
+ /// and world metadata. No data can be written.
223
+ /// This should be called before [`SystemParam::get_param`] when running systems
224
+ /// to ensure data can be acquired without panic.
222
225
///
223
226
/// # Safety
224
227
///
225
- /// - The passed [`UnsafeWorldCell`] must have read access to any world data
228
+ /// - The passed [`UnsafeWorldCell`] must have read-only access to world data
226
229
/// registered in [`init_state`](SystemParam::init_state).
227
230
/// - `world` must be the same [`World`] that was used to initialize [`state`](SystemParam::init_state).
228
231
unsafe fn validate_param (
@@ -2307,16 +2310,9 @@ trait DynParamState: Sync + Send {
2307
2310
/// Queues any deferred mutations to be applied at the next [`apply_deferred`](crate::prelude::apply_deferred).
2308
2311
fn queue ( & mut self , system_meta : & SystemMeta , world : DeferredWorld ) ;
2309
2312
2310
- /// Validates that the data can be acquired by [`get_param`](SystemParam::get_param).
2311
- /// If validation fails, resource acquisition will fail
2312
- /// and [`SystemParam::get_param`] won't be called.
2313
- /// For systems this means they won't be executed.
2314
- ///
2315
- /// # Safety
2313
+ /// Refer to [SystemParam::validate_param].
2316
2314
///
2317
- /// - The passed [`World`] must have access to any world data
2318
- /// registered in [`init_state`](SystemParam::init_state).
2319
- /// - `world` must be the same [`World`] that was used to initialize [`state`](SystemParam::init_state).
2315
+ /// # Safety: Refer to [SystemParam::validate_param].
2320
2316
unsafe fn validate_param ( & self , system_meta : & SystemMeta , world : UnsafeWorldCell ) -> bool ;
2321
2317
}
2322
2318
0 commit comments