Skip to content

Commit

Permalink
Add #[track_caller] to the borrow and borrow_mut of GcCell
Browse files Browse the repository at this point in the history
  • Loading branch information
Dangerise committed Aug 20, 2023
1 parent 949732c commit 0c66e17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ impl<T: ?Sized> GcCell<T> {
///
/// Panics if the value is currently mutably borrowed.
#[inline]
#[track_caller]
pub fn borrow(&self) -> GcCellRef<'_, T> {
match self.try_borrow() {
Ok(value) => value,
Expand All @@ -542,6 +543,7 @@ impl<T: Trace + ?Sized> GcCell<T> {
///
/// Panics if the value is currently borrowed.
#[inline]
#[track_caller]
pub fn borrow_mut(&self) -> GcCellRefMut<'_, T> {
match self.try_borrow_mut() {
Ok(value) => value,
Expand Down

0 comments on commit 0c66e17

Please sign in to comment.