From b3e4322c228017124deb9597e7e8fdf502ecfce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C8=9Bca=20Dumitru?= Date: Sun, 14 Jan 2024 20:37:54 +0200 Subject: [PATCH] glib: Mark panicky `BoxedAnyObject` methods as `track_caller` --- glib/src/boxed_any_object.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glib/src/boxed_any_object.rs b/glib/src/boxed_any_object.rs index ef7db2d7c8a9..7c28ebd68f29 100644 --- a/glib/src/boxed_any_object.rs +++ b/glib/src/boxed_any_object.rs @@ -98,6 +98,7 @@ impl BoxedAnyObject { // rustdoc-stripper-ignore-next /// Replaces the wrapped value with a new one, returning the old value, without deinitializing either one. /// The returned value is inside a `Box` and must be manually downcasted if needed. + #[track_caller] pub fn replace(&self, t: T) -> Box { self.imp().value.replace(Box::new(t) as Box) } @@ -158,6 +159,7 @@ impl BoxedAnyObject { /// /// For a non-panicking variant, use /// [`try_borrow`](#method.try_borrow). + #[track_caller] pub fn borrow(&self) -> Ref<'_, T> { Ref::map(self.imp().value.borrow(), |value| { value @@ -180,6 +182,7 @@ impl BoxedAnyObject { /// /// For a non-panicking variant, use /// [`try_borrow_mut`](#method.try_borrow_mut). + #[track_caller] pub fn borrow_mut(&self) -> RefMut<'_, T> { RefMut::map(self.imp().value.borrow_mut(), |value| { value