diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs index 07d01a8c870ab..d914f3488c430 100644 --- a/crates/bevy_ecs/macros/src/lib.rs +++ b/crates/bevy_ecs/macros/src/lib.rs @@ -506,7 +506,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream { >::get_param(&mut state.state, system_meta, world, change_tick); #struct_name { #(#fields: #field_locals,)* - #(#ignored_fields: <#ignored_field_types>::default(),)* + #(#ignored_fields: std::default::Default::default(),)* } } } diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index 4dc3a85bdbf1b..c97dcf397e396 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -1541,11 +1541,12 @@ mod tests { } // Compile test for https://github.com/bevyengine/bevy/pull/6919. + // Regression test for https://github.com/bevyengine/bevy/issues/7447. #[derive(SystemParam)] - struct MyParam<'w, T: Resource, Marker: 'static> { + struct IgnoredParam<'w, T: Resource, Marker: 'static> { _foo: Res<'w, T>, #[system_param(ignore)] - marker: PhantomData, + marker: PhantomData<&'w Marker>, } // Compile tests for https://github.com/bevyengine/bevy/pull/6957.