mirror of
https://github.com/bevyengine/bevy
synced 2024-12-22 11:03:06 +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 |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml | ||
README.md |
Compile fail tests for bevy_reflect
This crate is separate from bevy_reflect
and not part of the Bevy workspace in order to not fail crater
tests for
Bevy.
The tests assert on the exact compiler errors and can easily fail for new Rust versions due to updated compiler errors (e.g. changes in spans).
The CI
workflow executes these tests on the stable rust toolchain (see tools/ci).