Skip to content

Commit e707533

Browse files
authored
Rollup merge of rust-lang#60850 - SimonSapin:unguarded, r=alexcrichton
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 rust-lang#59211. Stabilizing would help do more of the same in libraries that also have users on Stable.
2 parents 1529ea6 + 9fd4d48 commit e707533

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
@@ -967,7 +967,6 @@ impl<T: ?Sized> RefCell<T> {
967967
/// # Examples
968968
///
969969
/// ```
970-
/// #![feature(borrow_state)]
971970
/// use std::cell::RefCell;
972971
///
973972
/// let c = RefCell::new(5);
@@ -982,7 +981,7 @@ impl<T: ?Sized> RefCell<T> {
982981
/// assert!(unsafe { c.try_borrow_unguarded() }.is_ok());
983982
/// }
984983
/// ```
985-
#[unstable(feature = "borrow_state", issue = "27733")]
984+
#[stable(feature = "borrow_state", since = "1.37.0")]
986985
#[inline]
987986
pub unsafe fn try_borrow_unguarded(&self) -> Result<&T, BorrowError> {
988987
if !is_writing(self.borrow.get()) {

0 commit comments

Comments
 (0)