From afa343ff08ec956bc1cc1473b8570b65a18046dd Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Thu, 26 May 2022 20:16:09 +0100 Subject: [PATCH] Add [track_caller] attribute when working with app data container --- src/lua.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lua.rs b/src/lua.rs index 5aac6c5..bfce9c9 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -2137,6 +2137,7 @@ impl Lua { /// Ok(()) /// } /// ``` + #[track_caller] pub fn set_app_data(&self, data: T) { let extra = unsafe { &mut (*self.extra.get()) }; extra @@ -2147,6 +2148,7 @@ impl Lua { } /// Gets a reference to an application data object stored by [`Lua::set_app_data()`] of type `T`. + #[track_caller] pub fn app_data_ref(&self) -> Option> { let extra = unsafe { &(*self.extra.get()) }; let app_data = extra @@ -2158,6 +2160,7 @@ impl Lua { } /// Gets a mutable reference to an application data object stored by [`Lua::set_app_data()`] of type `T`. + #[track_caller] pub fn app_data_mut(&self) -> Option> { let extra = unsafe { &(*self.extra.get()) }; let mut app_data = extra @@ -2169,6 +2172,7 @@ impl Lua { } /// Removes an application data of type `T`. + #[track_caller] pub fn remove_app_data(&self) -> Option { let extra = unsafe { &mut (*self.extra.get()) }; extra