bevy/crates
Gino Valente be2301dd78 bevy_reflect: Fix combined field attributes (#9322)
# Objective

It seems the behavior of field attributes was accidentally broken at
some point. Take the following code:

```rust
#[derive(Reflect)]
struct Foo {
  #[reflect(ignore, default)]
  value: usize
}
```

The above code should simply mark `value` as ignored and specify a
default behavior. However, what this actually does is discard both.
That's especially a problem when we don't want the field to be be given
a `Reflect` or `FromReflect` bound (which is why we ignore it in the
first place).

This only happens when the attributes are combined into one. The
following code works properly:

```rust
#[derive(Reflect)]
struct Foo {
  #[reflect(ignore)]
  #[reflect(default)]
  value: usize
}
```

## Solution

Cleaned up the field attribute parsing logic to support combined field
attributes.

---

## Changelog

- Fixed a bug where `Reflect` derive attributes on fields are not able
to be combined into a single attribute
2023-08-09 18:08:33 -07:00
..
bevy_a11y Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_animation Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_app Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_asset Improve Mesh documentation (#9061) 2023-08-09 18:04:04 -07:00
bevy_audio Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_core Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_core_pipeline Extend the default render range of 2D camera (#9310) 2023-08-09 18:06:15 -07:00
bevy_derive Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_diagnostic Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_dylib Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_dynamic_plugin Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_ecs Fix ambiguous_with breaking run conditions (#9253) 2023-08-09 18:06:37 -07:00
bevy_ecs_compile_fail_tests Resolve clippy issues for rust 1.70.0 (#8738) 2023-06-01 21:05:05 +00:00
bevy_encase_derive Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_gilrs Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_gizmos Clarify immediate mode in Gizmos documentation (#9183) 2023-08-09 18:06:01 -07:00
bevy_gltf Improve Mesh documentation (#9061) 2023-08-09 18:04:04 -07:00
bevy_hierarchy Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_input Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_internal Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_log Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_macro_utils Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_macros_compile_fail_tests bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_math Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_mikktspace Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_pbr Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_ptr Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_reflect bevy_reflect: Fix combined field attributes (#9322) 2023-08-09 18:08:33 -07:00
bevy_reflect_compile_fail_tests bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
bevy_render Improve Mesh documentation (#9061) 2023-08-09 18:04:04 -07:00
bevy_scene Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_sprite Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_tasks Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_text Fix for vertical text bounds and alignment (#9133) 2023-08-09 18:00:58 -07:00
bevy_time Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_transform Update GlobalTransform on insertion (#9081) 2023-08-09 18:00:29 -07:00
bevy_ui Remove the With<Parent> query filter from bevy_ui::render::extract_uinode_borders (#9285) 2023-08-09 18:06:25 -07:00
bevy_utils Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00
bevy_window improve documentation relating to WindowPlugin and Window (#9173) 2023-08-09 18:03:48 -07:00
bevy_winit Release 0.11.0 (#9080) 2023-07-09 08:43:47 +00:00