bevy/crates/bevy_ecs/macros/src
Emerson Coskey fb2d79ad60
Better macro errors for get_struct_fields (#17639)
# Objective

- Currently, the error span for `get_struct_field` when encountering an
enum or union points to the macro invocation, rather than the `enum` or
`union` token. It also doesn't mention which macro reported the error.

## Solution

- Report the correct error span
- Add parameter for passing in the name of the macro invocation

## Testing

Bevy compiles fine with this change

## Migration Guide

```rs
// before
let fields = get_struct_fields(&ast.data);

// after
let fields = get_struct_fields(&ast.data, "derive(Bundle)");
```

---------

Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com>
2025-05-26 16:57:03 +00:00
..
component.rs Derive clone_behavior for Components (#18811) 2025-05-06 00:32:59 +00:00
lib.rs Better macro errors for get_struct_fields (#17639) 2025-05-26 16:57:03 +00:00
query_data.rs Let FilteredEntity(Ref|Mut) receive access when nested. (#18236) 2025-05-05 23:23:46 +00:00
query_filter.rs Move Item and fetch to QueryData from WorldQuery (#17679) 2025-02-05 18:46:18 +00:00
world_query.rs Move Item and fetch to QueryData from WorldQuery (#17679) 2025-02-05 18:46:18 +00:00