Skip to content

[Merged by Bors] - Added missing Component Bound to Res<> and ResMut<> #1962

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl_query_set!();
/// Panics when used as a [`SystemParameter`](SystemParam) if the resource does not exist.
///
/// Use `Option<Res<T>>` instead if the resource might not always exist.
pub struct Res<'w, T> {
pub struct Res<'w, T: Component> {
value: &'w T,
ticks: &'w ComponentTicks,
last_change_tick: u32,
Expand Down Expand Up @@ -311,7 +311,7 @@ impl<'a, T: Component> SystemParamFetch<'a> for OptionResState<T> {
/// Panics when used as a [`SystemParameter`](SystemParam) if the resource does not exist.
///
/// Use `Option<ResMut<T>>` instead if the resource might not always exist.
pub struct ResMut<'w, T> {
pub struct ResMut<'w, T: Component> {
value: &'w mut T,
ticks: &'w mut ComponentTicks,
last_change_tick: u32,
Expand Down