bevy/crates
Gino Valente d1a6e919df bevy_reflect: Fix trailing comma breaking derives (#8014)
# Objective

Fixes #7989

Based on #7991 by @CoffeeVampir3

## Solution

There were three parts to this issue:
1. `extend_where_clause` did not account for the optionality of a where
clause's trailing comma
    ```rust
    // OKAY
    struct Foo<T> where T: Asset, {/* ... */}
    // ERROR
    struct Foo<T> where T: Asset {/* ... */}
    ```
2. `FromReflect` derive logic was not actively using
`extend_where_clause` which led to some inconsistencies (enums weren't
adding _any_ additional bounds even)
3. Using `extend_where_clause` in the `FromReflect` derive logic meant
we had to optionally add `Default` bounds to ignored fields iff the
entire item itself was not already `Default` (otherwise the definition
for `Handle<T>` wouldn't compile since `HandleType` doesn't impl
`Default` but `Handle<T>` itself does)

---

## Changelog

- Fixed issue where a missing trailing comma could break the reflection
derives
2023-03-28 01:50:37 +02:00
..
bevy_a11y Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_animation Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_app Fix Plugin::build detection (#8103) 2023-03-28 01:42:06 +02:00
bevy_asset Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_audio Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_core Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_core_pipeline Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_derive Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_diagnostic Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_dylib Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_dynamic_plugin Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_ecs Fix field visibility for read-only WorldQuery types (#8163) 2023-03-28 01:48:27 +02:00
bevy_ecs_compile_fail_tests EntityMut: rename remove_intersection to remove and remove to take (#7810) 2023-02-26 00:09:19 +00:00
bevy_encase_derive Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_gilrs Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_gltf Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_hierarchy Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_input add Clone to common conditions (#8060) 2023-03-28 01:29:06 +02:00
bevy_internal Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_log Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_macro_utils Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_math Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_mikktspace Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_pbr Dither fix (#7977) 2023-03-28 01:50:20 +02:00
bevy_ptr Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_reflect bevy_reflect: Fix trailing comma breaking derives (#8014) 2023-03-28 01:50:37 +02:00
bevy_reflect_compile_fail_tests bevy_reflect: Fix trailing comma breaking derives (#8014) 2023-03-28 01:50:37 +02:00
bevy_render Fix documentation on RegularPolygon (#8164) 2023-03-28 01:49:28 +02:00
bevy_scene add position to scene errors (#8065) 2023-03-28 01:44:54 +02:00
bevy_sprite Add ReflectComponent registration for Sprite (#8207) 2023-03-28 01:50:00 +02:00
bevy_tasks Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_text Fix the Text2d text anchor's incorrect horizontal alignment (#8019) 2023-03-28 01:25:28 +02:00
bevy_time add Clone to common conditions (#8060) 2023-03-28 01:29:06 +02:00
bevy_transform Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_ui Skip the UV calculations for untextured UI nodes (#7809) 2023-03-28 01:42:50 +02:00
bevy_utils Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_window Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00
bevy_winit Release 0.10.0 (#7919) 2023-03-06 03:53:02 +00:00