Skip to content

Conversation

@MushineLament
Copy link
Contributor

Objective

When acquiring Commands within SystemState, it causes incorrect tracking of MaybeLocation in CommandQueue, mistakenly pointing to the FromWorld trait implementation.

Solution

Add track_caller support for the Commands SystemParam.

Testing

I only verified whether tracking is present, but did not perform any tests.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 4, 2026
@alice-i-cecile alice-i-cecile added the X-Uncontroversial This work is generally agreed upon label Jan 4, 2026
@hymm
Copy link
Contributor

hymm commented Jan 8, 2026

What's the code that fails before this change?

Copy link
Contributor

@chescock chescock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense! It's never going to be useful to report a location from these methods, so marking them as #[track_caller] seems like a good plan.

It might be good to also add #[track_caller] to a few other places where system parameters can be nested, such as StaticSystemParam and #[derive(SystemParam)], but those could always be done as a follow-up!

@alice-i-cecile alice-i-cecile 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 Jan 8, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 8, 2026
@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Jan 8, 2026
Merged via the queue into bevyengine:main with commit ef7bce8 Jan 8, 2026
40 checks passed
cart pushed a commit that referenced this pull request Jan 9, 2026
# Objective

When acquiring Commands within SystemState, it causes incorrect tracking
of MaybeLocation in CommandQueue, mistakenly pointing to the FromWorld
trait implementation.

## Solution

Add track_caller support for the Commands SystemParam.

## Testing

I only verified whether tracking is present, but did not perform any
tests.

Co-authored-by: Mushine Lament <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants