diff options
author | bors-servo <servo-ops@mozilla.com> | 2020-06-19 00:37:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-19 00:37:22 -0400 |
commit | 1527afff179e7b40df62133e1880c6421cab7f98 (patch) | |
tree | f8d22de2f4c697976822cf877670fc06ddbfc63d | |
parent | 8e3b4b6fe5c39a746082d1db9d5c44a1c00dc56b (diff) | |
parent | da3b3e3985621ffd2f6d9b65583f4f498190402c (diff) | |
download | servo-1527afff179e7b40df62133e1880c6421cab7f98.tar.gz servo-1527afff179e7b40df62133e1880c6421cab7f98.zip |
Auto merge of #26975 - servo:jdm-patch-44, r=gterzian
Fix refcell_backtrace feature.
This makes the output of a borrow error contain the expected list of conflicting borrows. Fixes #26971.
-rw-r--r-- | components/script/dom/bindings/cell.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs index a9aa8119fa9..7d567e04847 100644 --- a/components/script/dom/bindings/cell.rs +++ b/components/script/dom/bindings/cell.rs @@ -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. @@ -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. |