mirror of
https://github.com/bevyengine/bevy
synced 2025-01-03 00:38:56 +00:00
5e5a305d43
# 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 |
||
---|---|---|
.. | ||
impls | ||
container_attributes.rs | ||
derive_data.rs | ||
documentation.rs | ||
enum_utility.rs | ||
field_attributes.rs | ||
fq_std.rs | ||
from_reflect.rs | ||
lib.rs | ||
reflect_value.rs | ||
registration.rs | ||
trait_reflection.rs | ||
type_uuid.rs | ||
utility.rs |