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.
This commit is contained in:
JoJoJet 2023-01-23 22:34:32 +00:00
parent a3baf2ae86
commit e84907fc55

View file

@ -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<const I: usize>;
// Compile test for https://github.com/bevyengine/bevy/pull/7001.
#[derive(SystemParam)]
pub struct ConstGenericParam<'w, const I: usize>(Res<'w, R<I>>);
// 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<Marker>,
}
// 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>);