-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
1e73312
commit 15be0d1
Showing
2 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters