Skip to content

Commit 9fd4d48

Browse files
committed
Stabilize RefCell::try_borrow_unguarded
Servo has been using this since servo/servo#23196 to add a runtime check to some unsafe code, as discussed in PR #59211. Stabilizing would help do more of the same in libraries that also have users on Stable.
1 parent c84a7ab commit 9fd4d48

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/doc/unstable-book/src/library-features/borrow-state.md

-7
This file was deleted.

src/libcore/cell.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,6 @@ impl<T: ?Sized> RefCell<T> {
969969
/// # Examples
970970
///
971971
/// ```
972-
/// #![feature(borrow_state)]
973972
/// use std::cell::RefCell;
974973
///
975974
/// let c = RefCell::new(5);
@@ -984,7 +983,7 @@ impl<T: ?Sized> RefCell<T> {
984983
/// assert!(unsafe { c.try_borrow_unguarded() }.is_ok());
985984
/// }
986985
/// ```
987-
#[unstable(feature = "borrow_state", issue = "27733")]
986+
#[stable(feature = "borrow_state", since = "1.37.0")]
988987
#[inline]
989988
pub unsafe fn try_borrow_unguarded(&self) -> Result<&T, BorrowError> {
990989
if !is_writing(self.borrow.get()) {

0 commit comments

Comments
 (0)