bevy/crates/bevy_ecs/src/world
0xc0001a2040 15be0d1a61
Add/fix track_caller attribute on panicking entity accessor methods (#8951)
# Objective

`World::entity`, `World::entity_mut` and `Commands::entity` should be
marked with `track_caller` to display where (in user code) the call with
the invalid `Entity` was made. `Commands::entity` already has the
attibute, but it does nothing due to the call to `unwrap_or_else`.

## Solution

- Apply the `track_caller` attribute to the `World::entity_mut` and
`World::entity`.
- Remove the call to `unwrap_or_else` which makes the `track_caller`
attribute useless (because `unwrap_or_else` is not `track_caller`
itself). The avoid eager evaluation of the panicking branch it is never
inlined.

---------

Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
2023-06-26 18:35:11 +00:00
..
entity_ref.rs extract common code from a if block (#8959) 2023-06-26 15:17:56 +00:00
error.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
identifier.rs Improve safety for the multi-threaded executor using UnsafeWorldCell (#8292) 2023-05-29 15:22:10 +00:00
mod.rs Add/fix track_caller attribute on panicking entity accessor methods (#8951) 2023-06-26 18:35:11 +00:00
spawn_batch.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
unsafe_world_cell.rs Migrate the rest of the engine to UnsafeWorldCell (#8833) 2023-06-15 01:31:56 +00:00
world_cell.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00