bevy/crates/bevy_reflect/derive/src
Wuketuke 5c3368fbcf
Fixed Reflect derive macro on empty enums (#18277) (#18298)
obtaining a reference to an empty enum is not possible in Rust, so I
just replaced any match on self with an `unreachable!()`
I checked if an enum is empty by checking if the `variant_patterns` vec
of the `EnumVariantOutputData` struct is empty
Fixes #18277

## Testing

I added one new unit test.
``` rust
#[test]
fn should_allow_empty_enums() {
    #[derive(Reflect)]
    enum Empty {}

    assert_impl_all!(Empty: Reflect);
}
```
2025-03-17 18:13:55 +00:00
..
impls bevy_reflect: Deprecate PartialReflect::clone_value (#18284) 2025-03-14 19:33:57 +00:00
attribute_parser.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
container_attributes.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
custom_attributes.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
derive_data.rs Fixed Reflect derive macro on empty enums (#18277) (#18298) 2025-03-17 18:13:55 +00:00
documentation.rs Rename bevy_reflect_derive folder to derive (#13269) 2024-05-07 07:55:32 +00:00
enum_utility.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
field_attributes.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
from_reflect.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
generics.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
ident.rs split bevy_reflect::derive::utilities into proper modules (#15354) 2024-09-22 14:24:14 +00:00
lib.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
meta.rs Use one BevyManifest instance in proc macros (#16766) 2024-12-15 15:00:05 +00:00
reflect_opaque.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
registration.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
remote.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
result_sifter.rs split bevy_reflect::derive::utilities into proper modules (#15354) 2024-09-22 14:24:14 +00:00
serialization.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
string_expr.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
struct_utility.rs bevy_reflect: Reflection-based cloning (#13432) 2025-03-11 06:02:59 +00:00
trait_reflection.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
type_path.rs Rename bevy_reflect_derive folder to derive (#13269) 2024-05-07 07:55:32 +00:00
where_clause_options.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00