mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Fix a miscompilation with #[derive(SystemParam)]
(#7105)
# Objective - Fix #7103. - The issue is caused because I forgot to add a where clause to a generated struct in #7056. ## Solution - Add the where clause.
This commit is contained in:
parent
a207178344
commit
fa40e2badb
2 changed files with 11 additions and 1 deletions
|
@ -465,7 +465,8 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream {
|
|||
// <EventReader<'static, 'static, T> as SystemParam>::State
|
||||
const _: () = {
|
||||
#[doc(hidden)]
|
||||
#state_struct_visibility struct FetchState <'w, 's, #(#lifetimeless_generics,)*> {
|
||||
#state_struct_visibility struct FetchState <'w, 's, #(#lifetimeless_generics,)*>
|
||||
#where_clause {
|
||||
state: (#(<#tuple_types as #path::system::SystemParam>::State,)*),
|
||||
marker: std::marker::PhantomData<(
|
||||
<#path::prelude::Query<'w, 's, ()> as #path::system::SystemParam>::State,
|
||||
|
|
|
@ -1639,4 +1639,13 @@ mod tests {
|
|||
|
||||
#[derive(SystemParam)]
|
||||
pub struct EncapsulatedParam<'w>(Res<'w, PrivateResource>);
|
||||
|
||||
// regression test for https://github.com/bevyengine/bevy/issues/7103.
|
||||
#[derive(SystemParam)]
|
||||
pub struct WhereParam<'w, 's, Q>
|
||||
where
|
||||
Q: 'static + WorldQuery,
|
||||
{
|
||||
_q: Query<'w, 's, Q, ()>,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue