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
					
				| @ -465,7 +465,8 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream { | |||||||
|         // <EventReader<'static, 'static, T> as SystemParam>::State
 |         // <EventReader<'static, 'static, T> as SystemParam>::State
 | ||||||
|         const _: () = { |         const _: () = { | ||||||
|             #[doc(hidden)] |             #[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,)*), |                 state: (#(<#tuple_types as #path::system::SystemParam>::State,)*), | ||||||
|                 marker: std::marker::PhantomData<( |                 marker: std::marker::PhantomData<( | ||||||
|                     <#path::prelude::Query<'w, 's, ()> as #path::system::SystemParam>::State, |                     <#path::prelude::Query<'w, 's, ()> as #path::system::SystemParam>::State, | ||||||
|  | |||||||
| @ -1639,4 +1639,13 @@ mod tests { | |||||||
| 
 | 
 | ||||||
|     #[derive(SystemParam)] |     #[derive(SystemParam)] | ||||||
|     pub struct EncapsulatedParam<'w>(Res<'w, PrivateResource>); |     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 New Issue
	
	Block a user
	 JoJoJet
						JoJoJet