Skip to content

Commit 4da908f

Browse files
committed
better trait method doc
1 parent 1c695fb commit 4da908f

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
@@ -133,12 +133,18 @@ pub unsafe trait SystemParamState: Send + Sync + 'static {
133133

134134
/// # Safety
135135
///
136-
/// This function must:
137-
/// - return [`WorldAccessLevel::Exclusive`] if [`get_param`](SystemParamFetch::get_param)
138-
/// constructs a [`&mut World`](World).
139-
/// - return [`WorldAccessLevel::Shared`] if
140-
/// [`get_param`](SystemParamFetch::get_param) constructs a [`&World`](World).
141-
/// - **panic** if [`get_param`](SystemParamFetch::get_param) would construct both at the same time.
136+
/// This function must return:
137+
/// - [`WorldAccessLevel::Exclusive`] if [`get_param`](SystemParamFetch::get_param)
138+
/// internally constructs a [`&mut World`](World) (or a type that can make one).
139+
/// - [`WorldAccessLevel::Shared`] if [`get_param`](SystemParamFetch::get_param)
140+
/// internally constructs a [`&World`](World) (or a type that can make one).
141+
/// - [`WorldAccessLevel::None`] otherwise.
142+
///
143+
/// # Panics
144+
///
145+
/// During system construction, [`SystemParam`] tuples and implementations
146+
/// produced by the [`#[derive(SystemParam)`](`derive@super::SystemParam`)
147+
/// macro will panic on invalid combinations that would be undefined behavior.
142148
fn world_access_level() -> WorldAccessLevel;
143149
}
144150

0 commit comments

Comments
 (0)