about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-05-15 11:54:16 +0200
committerSimon Sapin <simon.sapin@exyr.org>2019-05-15 11:54:16 +0200
commit9fd4d48b5e12494926041bb1a053d5891e661bc4 (patch)
treed73c64ca0b7e39013b83264654f3cf84ec69906f /src/libcore
parentc84a7abf8b2c5753179472464dc2baeb86c6fed6 (diff)
Stabilize RefCell::try_borrow_unguarded
Servo has been using this since https://github.com/servo/servo/pull/23196 to add a runtime check to some unsafe code, as discussed in PR https://github.com/rust-lang/rust/pull/59211. Stabilizing would help do more of the same in libraries that also have users on Stable.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/cell.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index fcfd80d9266..5fc819f8efc 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -969,7 +969,6 @@ impl<T: ?Sized> RefCell<T> {
     /// # Examples
     ///
     /// ```
-    /// #![feature(borrow_state)]
     /// use std::cell::RefCell;
     ///
     /// let c = RefCell::new(5);
@@ -984,7 +983,7 @@ impl<T: ?Sized> RefCell<T> {
     ///     assert!(unsafe { c.try_borrow_unguarded() }.is_ok());
     /// }
     /// ```
-    #[unstable(feature = "borrow_state", issue = "27733")]
+    #[stable(feature = "borrow_state", since = "1.37.0")]
     #[inline]
     pub unsafe fn try_borrow_unguarded(&self) -> Result<&T, BorrowError> {
         if !is_writing(self.borrow.get()) {