add missing #[track_caller]
(#19769)
# Objective I've noticed that some methods with `MaybeLocation::caller` don't have `#[track_caller]` which resulted in wrong locations reported when `track_location` is enabled. ## Solution add `#[track_caller]` to them.
This commit is contained in:
parent
4ff595a4bc
commit
2d897380a0
@ -223,6 +223,7 @@ pub fn trigger(event: impl Event) -> impl Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A [`Command`] that sends an [`EntityEvent`] for the given targets.
|
/// A [`Command`] that sends an [`EntityEvent`] for the given targets.
|
||||||
|
#[track_caller]
|
||||||
pub fn trigger_targets(
|
pub fn trigger_targets(
|
||||||
event: impl EntityEvent,
|
event: impl EntityEvent,
|
||||||
targets: impl TriggerTargets + Send + Sync + 'static,
|
targets: impl TriggerTargets + Send + Sync + 'static,
|
||||||
|
@ -96,6 +96,7 @@ impl<'w> DeferredWorld<'w> {
|
|||||||
/// If you do not need to ensure the above hooks are triggered, and your component
|
/// If you do not need to ensure the above hooks are triggered, and your component
|
||||||
/// is mutable, prefer using [`get_mut`](DeferredWorld::get_mut).
|
/// is mutable, prefer using [`get_mut`](DeferredWorld::get_mut).
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[track_caller]
|
||||||
pub(crate) fn modify_component<T: Component, R>(
|
pub(crate) fn modify_component<T: Component, R>(
|
||||||
&mut self,
|
&mut self,
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
@ -129,6 +130,7 @@ impl<'w> DeferredWorld<'w> {
|
|||||||
/// You should prefer the typed [`modify_component`](DeferredWorld::modify_component)
|
/// You should prefer the typed [`modify_component`](DeferredWorld::modify_component)
|
||||||
/// whenever possible.
|
/// whenever possible.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[track_caller]
|
||||||
pub(crate) fn modify_component_by_id<R>(
|
pub(crate) fn modify_component_by_id<R>(
|
||||||
&mut self,
|
&mut self,
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
|
@ -1311,6 +1311,7 @@ impl World {
|
|||||||
/// # assert_eq!(world.get::<Foo>(entity), Some(&Foo(true)));
|
/// # assert_eq!(world.get::<Foo>(entity), Some(&Foo(true)));
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[track_caller]
|
||||||
pub fn modify_component<T: Component, R>(
|
pub fn modify_component<T: Component, R>(
|
||||||
&mut self,
|
&mut self,
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
@ -1339,6 +1340,7 @@ impl World {
|
|||||||
/// You should prefer the typed [`modify_component`](World::modify_component)
|
/// You should prefer the typed [`modify_component`](World::modify_component)
|
||||||
/// whenever possible.
|
/// whenever possible.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[track_caller]
|
||||||
pub fn modify_component_by_id<R>(
|
pub fn modify_component_by_id<R>(
|
||||||
&mut self,
|
&mut self,
|
||||||
entity: Entity,
|
entity: Entity,
|
||||||
|
Loading…
Reference in New Issue
Block a user