From 7fc02b6ff81806079ac46810a2a346aeca6e6ddc Mon Sep 17 00:00:00 2001 From: JoJoJet <21144246+JoJoJet@users.noreply.github.com> Date: Mon, 23 Jan 2023 22:34:32 +0000 Subject: [PATCH] Add context to compile tests (#7342) # Objective `bevy_ecs/system_param.rs` contains many seemingly-arbitrary struct definitions which serve as compile tests. ## Solution Add a comment to each one, linking the issue or PR that motivated its addition. --- crates/bevy_ecs/src/system/system_param.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index 4c1288ceb92de2..48df3c9f4032bc 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -1481,7 +1481,7 @@ mod tests { system::Query, }; - // Compile test for #2838 + // Compile test for https://github.com/bevyengine/bevy/pull/2838. #[derive(SystemParam)] pub struct SpecialQuery< 'w, @@ -1492,6 +1492,8 @@ mod tests { _query: Query<'w, 's, Q, F>, } + // Compile tests for https://github.com/bevyengine/bevy/pull/6694. + #[derive(SystemParam)] pub struct SpecialRes<'w, T: Resource> { _res: Res<'w, T>, @@ -1505,9 +1507,11 @@ mod tests { #[derive(Resource)] pub struct R; + // Compile test for https://github.com/bevyengine/bevy/pull/7001. #[derive(SystemParam)] pub struct ConstGenericParam<'w, const I: usize>(Res<'w, R>); + // Compile test for https://github.com/bevyengine/bevy/pull/6867. #[derive(SystemParam)] pub struct LongParam<'w> { _r0: Res<'w, R<0>>, @@ -1534,6 +1538,7 @@ mod tests { crate::system::assert_is_system(long_system); } + // Compile test for https://github.com/bevyengine/bevy/pull/6919. #[derive(SystemParam)] struct MyParam<'w, T: Resource, Marker: 'static> { _foo: Res<'w, T>, @@ -1541,6 +1546,8 @@ mod tests { marker: PhantomData, } + // Compile tests for https://github.com/bevyengine/bevy/pull/6957. + #[derive(SystemParam)] pub struct UnitParam; @@ -1553,6 +1560,7 @@ mod tests { #[derive(Resource)] struct PrivateResource; + // Regression test for https://github.com/bevyengine/bevy/issues/4200. #[derive(SystemParam)] pub struct EncapsulatedParam<'w>(Res<'w, PrivateResource>);