Skip to content

Use absolute paths in declarative macros#24261

Open
DavidCrossman wants to merge 6 commits into
bevyengine:mainfrom
DavidCrossman:declarative_macro_absolute_paths
Open

Use absolute paths in declarative macros#24261
DavidCrossman wants to merge 6 commits into
bevyengine:mainfrom
DavidCrossman:declarative_macro_absolute_paths

Conversation

@DavidCrossman
Copy link
Copy Markdown
Contributor

Objective

  • Improve declarative macro hygiene.
  • Fix declarative macros using non-imported items.
    • AnimatedField is unqualified in the animated_field macro.
    • offset_of is unqualified in the impl_atomic_pod macro.
    • format is unqualified in hash_error macro (requires import in no_std).

Solution

  • Qualify unqualified items and use absolute paths in every public (#[macro_export]) macro_rules.
  • Re-export format in bevy_reflect::__macro_exports::alloc_utils.

Testing

  • Ran cargo run -p ci -- compile

@kfc35 kfc35 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Macros Code that generates Rust code C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. labels May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. D-Macros Code that generates Rust code S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants