Skip to content

Document define_label! sufficiently that it can be used.#24444

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
kpreid:define-label
Jun 2, 2026
Merged

Document define_label! sufficiently that it can be used.#24444
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
kpreid:define-label

Conversation

@kpreid
Copy link
Copy Markdown
Contributor

@kpreid kpreid commented May 25, 2026

Objective

Fixes #22834.

Solution

  • Add more explanation of what define_label! does
  • Add example implementations
  • Change the existing extra_methods_impl example to forward the call

This PR will conflict with #24445. I will rebase whichever one doesn’t get merged first.

Testing

  • Ran doctests
  • Reviewed rendered documentation

Comment thread crates/bevy_ecs/src/label.rs Outdated
@kfc35 kfc35 added C-Docs An addition or correction to our documentation A-App Bevy apps and plugins S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 25, 2026
Comment thread crates/bevy_ecs/src/label.rs Outdated
@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 26, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 2, 2026
Merged via the queue into bevyengine:main with commit 4781fa0 Jun 2, 2026
38 checks passed
@kpreid kpreid deleted the define-label branch June 2, 2026 03:45
pull Bot pushed a commit to VitalyAnkh/bevy that referenced this pull request Jun 2, 2026
…erner private. (bevyengine#24445)

# Objective

Simplify the use of `define_label!()`.

## Solution

- Move the `static` interner inside the `intern()` method, so that it is
not visible anywhere else and does not need to have a non-conflicting
name. The only operation the interner has is interning, so the
`intern()` trait method is all the access that is ever needed.
- Also added support for trailing commas.

This PR will conflict with bevyengine#24444. I will rebase whichever one doesn’t
get merged first.

## Testing

- Ran tests with `cargo run -p ci -- --keep-going test`. There were some
failures that I believe are existing/spurious.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-App Bevy apps and plugins C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ecs::define_label! usage documentation is incomplete

4 participants