Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a paragraph to the lifetimeless module doc #9312

Merged
merged 2 commits into from Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion crates/bevy_ecs/src/system/system_param.rs
Expand Up @@ -1413,9 +1413,16 @@ macro_rules! impl_system_param_tuple {
all_tuples!(impl_system_param_tuple, 0, 16, P);

/// Contains type aliases for built-in [`SystemParam`]s with `'static` lifetimes.
/// This can make it more convenient to refer to these types in contexts where
/// This makes it more convenient to refer to these types in contexts where
/// explicit lifetime annotations are required.
///
/// Note that this is entirely safe and tracks lifetimes correctly.
/// This purely exists for convenience.
///
/// You can't instantiate a static `SystemParam`, you'll always end up with
/// `Res<'w, T>`, `ResMut<'w, T>` or `&'w T` bound to the lifetime of the provided
/// `&'w World`.
///
/// [`SystemParam`]: super::SystemParam
pub mod lifetimeless {
/// A [`Query`](super::Query) with `'static` lifetimes.
Expand Down