Skip to content

Commit

Permalink
Auto merge of #26975 - servo:jdm-patch-44, r=gterzian
Browse files Browse the repository at this point in the history
Fix refcell_backtrace feature.

This makes the output of a borrow error contain the expected list of conflicting borrows. Fixes #26971.
  • Loading branch information
bors-servo committed Jun 19, 2020
2 parents 8e3b4b6 + da3b3e3 commit 1527aff
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/script/dom/bindings/cell.rs
Expand Up @@ -75,8 +75,7 @@ impl<T> DomRefCell<T> {
///
/// Panics if the value is currently mutably borrowed.
pub fn borrow(&self) -> Ref<T> {
self.try_borrow()
.expect("DomRefCell<T> already mutably borrowed")
self.value.borrow()
}

/// Mutably borrows the wrapped value.
Expand All @@ -90,8 +89,7 @@ impl<T> DomRefCell<T> {
///
/// Panics if the value is currently borrowed.
pub fn borrow_mut(&self) -> RefMut<T> {
self.try_borrow_mut()
.expect("DomRefCell<T> already borrowed")
self.value.borrow_mut()
}

/// Attempts to immutably borrow the wrapped value.
Expand Down

0 comments on commit 1527aff

Please sign in to comment.