@@ -218,11 +218,13 @@ 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 and world metadata.
222
+ /// This should be called before [`SystemParam::get_param`] when running systems
223
+ /// to ensure data can be acquired without panic.
222
224
///
223
225
/// # Safety
224
226
///
225
- /// - The passed [`UnsafeWorldCell`] must have read access to any world data
227
+ /// - The passed [`UnsafeWorldCell`] must have read-only access to world data
226
228
/// registered in [`init_state`](SystemParam::init_state).
227
229
/// - `world` must be the same [`World`] that was used to initialize [`state`](SystemParam::init_state).
228
230
unsafe fn validate_param (
@@ -2307,16 +2309,9 @@ trait DynParamState: Sync + Send {
2307
2309
/// Queues any deferred mutations to be applied at the next [`apply_deferred`](crate::prelude::apply_deferred).
2308
2310
fn queue ( & mut self , system_meta : & SystemMeta , world : DeferredWorld ) ;
2309
2311
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
2312
+ /// Refer to [SystemParam::validate_param].
2316
2313
///
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).
2314
+ /// # Safety: Refer to [SystemParam::validate_param].
2320
2315
unsafe fn validate_param ( & self , system_meta : & SystemMeta , world : UnsafeWorldCell ) -> bool ;
2321
2316
}
2322
2317
0 commit comments