Skip to content

Commit 25a5735

Browse files
committed
better trait method doc
1 parent e967e06 commit 25a5735

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

crates/bevy_ecs/src/system/system_param.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,18 @@ pub unsafe trait SystemParamState: Send + Sync + 'static {
118118

119119
/// # Safety
120120
///
121-
/// This function must:
122-
/// - return [`WorldAccessLevel::Exclusive`] if [`get_param`](SystemParamFetch::get_param)
123-
/// constructs a [`&mut World`](World).
124-
/// - return [`WorldAccessLevel::Shared`] if
125-
/// [`get_param`](SystemParamFetch::get_param) constructs a [`&World`](World).
126-
/// - **panic** if [`get_param`](SystemParamFetch::get_param) would construct both at the same time.
121+
/// This function must return:
122+
/// - [`WorldAccessLevel::Exclusive`] if [`get_param`](SystemParamFetch::get_param)
123+
/// internally constructs a [`&mut World`](World) (or a type that can make one).
124+
/// - [`WorldAccessLevel::Shared`] if [`get_param`](SystemParamFetch::get_param)
125+
/// internally constructs a [`&World`](World) (or a type that can make one).
126+
/// - [`WorldAccessLevel::None`] otherwise.
127+
///
128+
/// # Panics
129+
///
130+
/// During system construction, [`SystemParam`] tuples and implementations
131+
/// produced by the [`#[derive(SystemParam)`](`derive@super::SystemParam`)
132+
/// macro will panic on invalid combinations that would be undefined behavior.
127133
fn world_access_level() -> WorldAccessLevel;
128134
}
129135

0 commit comments

Comments
 (0)