1
Fork 0

Deprecate std::cell::RefCell::borrow_state

This commit is contained in:
Aaron Turon 2016-12-14 12:38:14 -08:00
parent b2882709b3
commit dc2d5058e9

View file

@ -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() {