diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index 9b20116ad5913..39ed373a785e2 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -686,6 +686,7 @@ impl App { /// Panics if one of the plugins was already added to the application. /// /// [`PluginGroup`]:super::PluginGroup + #[track_caller] pub fn add_plugins(&mut self, plugins: impl Plugins) -> &mut Self { plugins.add_to_app(self); self diff --git a/crates/bevy_app/src/plugin.rs b/crates/bevy_app/src/plugin.rs index 12e7d1f1c8d66..e20e536ca966f 100644 --- a/crates/bevy_app/src/plugin.rs +++ b/crates/bevy_app/src/plugin.rs @@ -89,6 +89,7 @@ mod sealed { pub struct PluginsTupleMarker; impl Plugins for P { + #[track_caller] fn add_to_app(self, app: &mut App) { if let Err(AppError::DuplicatePlugin { plugin_name }) = app.add_boxed_plugin(Box::new(self)) @@ -101,6 +102,7 @@ mod sealed { } impl Plugins for P { + #[track_caller] fn add_to_app(self, app: &mut App) { self.build().finish(app); } @@ -113,6 +115,7 @@ mod sealed { $($plugins: Plugins<$param>),* { #[allow(non_snake_case, unused_variables)] + #[track_caller] fn add_to_app(self, app: &mut App) { let ($($plugins,)*) = self; $($plugins.add_to_app(app);)* diff --git a/crates/bevy_app/src/plugin_group.rs b/crates/bevy_app/src/plugin_group.rs index 5b512ab0a41ba..a299c0a4f1583 100644 --- a/crates/bevy_app/src/plugin_group.rs +++ b/crates/bevy_app/src/plugin_group.rs @@ -172,6 +172,7 @@ impl PluginGroupBuilder { /// # Panics /// /// Panics if one of the plugin in the group was already added to the application. + #[track_caller] pub fn finish(mut self, app: &mut App) { for ty in &self.order { if let Some(entry) = self.plugins.remove(ty) {