Deprecate std::cell::RefCell::borrow_state
This commit is contained in:
parent
b2882709b3
commit
dc2d5058e9
1 changed files with 2 additions and 0 deletions
|
@ -393,6 +393,7 @@ pub struct RefCell<T: ?Sized> {
|
|||
/// An enumeration of values returned from the `state` method on a `RefCell<T>`.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
#[unstable(feature = "borrow_state", issue = "27733")]
|
||||
#[rustc_deprecated(since = "1.15.0", reason = "use `try_borrow` instead")]
|
||||
pub enum BorrowState {
|
||||
/// The cell is currently being read, there is at least one active `borrow`.
|
||||
Reading,
|
||||
|
@ -511,6 +512,7 @@ impl<T: ?Sized> RefCell<T> {
|
|||
/// }
|
||||
/// ```
|
||||
#[unstable(feature = "borrow_state", issue = "27733")]
|
||||
#[rustc_deprecated(since = "1.15.0", reason = "use `try_borrow` instead")]
|
||||
#[inline]
|
||||
pub fn borrow_state(&self) -> BorrowState {
|
||||
match self.borrow.get() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue