mirror of
https://github.com/bevyengine/bevy
synced 2024-12-23 11:33:06 +00:00
daa8bf20df
# Objective > Issue raised on [Discord](https://discord.com/channels/691052431525675048/1002362493634629796/1179182488787103776) Currently the following code fails due to a missing `TypePath` bound: ```rust #[derive(Reflect)] struct Foo<T>(T); #[derive(Reflect)] struct Bar<T>(Foo<T>); #[derive(Reflect)] struct Baz<T>(Bar<Foo<T>>); ``` ## Solution Add `TypePath` to the per-field bounds instead of _just_ the generic type parameter bounds. ### Related Work It should be noted that #9046 would help make these kinds of issues easier to work around and/or avoid entirely. --- ## Changelog - Fixes missing `TypePath` requirement when deriving `Reflect` on nested generics |
||
---|---|---|
.. | ||
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).