@@ -229,7 +229,7 @@ impl<T:Copy> Cell<T> {
229
229
/// let uc = unsafe { c.as_unsafe_cell() };
230
230
/// ```
231
231
#[ inline]
232
- #[ unstable( feature = "core " ) ]
232
+ #[ unstable( feature = "as_unsafe_cell " ) ]
233
233
pub unsafe fn as_unsafe_cell < ' a > ( & ' a self ) -> & ' a UnsafeCell < T > {
234
234
& self . value
235
235
}
@@ -277,7 +277,7 @@ pub struct RefCell<T: ?Sized> {
277
277
278
278
/// An enumeration of values returned from the `state` method on a `RefCell<T>`.
279
279
#[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
280
- #[ unstable( feature = "std_misc " ) ]
280
+ #[ unstable( feature = "borrow_state " ) ]
281
281
pub enum BorrowState {
282
282
/// The cell is currently being read, there is at least one active `borrow`.
283
283
Reading ,
@@ -339,7 +339,7 @@ impl<T: ?Sized> RefCell<T> {
339
339
///
340
340
/// The returned value can be dispatched on to determine if a call to
341
341
/// `borrow` or `borrow_mut` would succeed.
342
- #[ unstable( feature = "std_misc " ) ]
342
+ #[ unstable( feature = "borrow_state " ) ]
343
343
#[ inline]
344
344
pub fn borrow_state ( & self ) -> BorrowState {
345
345
match self . borrow . get ( ) {
@@ -448,7 +448,7 @@ impl<T: ?Sized> RefCell<T> {
448
448
///
449
449
/// This function is `unsafe` because `UnsafeCell`'s field is public.
450
450
#[ inline]
451
- #[ unstable( feature = "core " ) ]
451
+ #[ unstable( feature = "as_unsafe_cell " ) ]
452
452
pub unsafe fn as_unsafe_cell < ' a > ( & ' a self ) -> & ' a UnsafeCell < T > {
453
453
& self . value
454
454
}
@@ -564,9 +564,10 @@ impl<'b, T: ?Sized> Ref<'b, T> {
564
564
///
565
565
/// The `RefCell` is already immutably borrowed, so this cannot fail.
566
566
///
567
- /// This is an associated function that needs to be used as `Ref::clone(...)`.
568
- /// A `Clone` implementation or a method would interfere with the widespread
569
- /// use of `r.borrow().clone()` to clone the contents of a `RefCell`.
567
+ /// This is an associated function that needs to be used as
568
+ /// `Ref::clone(...)`. A `Clone` implementation or a method would interfere
569
+ /// with the widespread use of `r.borrow().clone()` to clone the contents of
570
+ /// a `RefCell`.
570
571
#[ unstable( feature = "cell_extras" ,
571
572
reason = "likely to be moved to a method, pending language changes" ) ]
572
573
#[ inline]
@@ -582,8 +583,8 @@ impl<'b, T: ?Sized> Ref<'b, T> {
582
583
/// The `RefCell` is already immutably borrowed, so this cannot fail.
583
584
///
584
585
/// This is an associated function that needs to be used as `Ref::map(...)`.
585
- /// A method would interfere with methods of the same name on the contents of a `RefCell`
586
- /// used through `Deref`.
586
+ /// A method would interfere with methods of the same name on the contents
587
+ /// of a `RefCell` used through `Deref`.
587
588
///
588
589
/// # Example
589
590
///
@@ -607,13 +608,14 @@ impl<'b, T: ?Sized> Ref<'b, T> {
607
608
}
608
609
}
609
610
610
- /// Make a new `Ref` for a optional component of the borrowed data, e.g. an enum variant.
611
+ /// Make a new `Ref` for a optional component of the borrowed data, e.g. an
612
+ /// enum variant.
611
613
///
612
614
/// The `RefCell` is already immutably borrowed, so this cannot fail.
613
615
///
614
- /// This is an associated function that needs to be used as `Ref::filter_map(...)`.
615
- /// A method would interfere with methods of the same name on the contents of a `RefCell`
616
- /// used through `Deref`.
616
+ /// This is an associated function that needs to be used as
617
+ /// `Ref::filter_map(...)`. A method would interfere with methods of the
618
+ /// same name on the contents of a `RefCell` used through `Deref`.
617
619
///
618
620
/// # Example
619
621
///
@@ -639,13 +641,14 @@ impl<'b, T: ?Sized> Ref<'b, T> {
639
641
}
640
642
641
643
impl < ' b , T : ?Sized > RefMut < ' b , T > {
642
- /// Make a new `RefMut` for a component of the borrowed data, e.g. an enum variant.
644
+ /// Make a new `RefMut` for a component of the borrowed data, e.g. an enum
645
+ /// variant.
643
646
///
644
647
/// The `RefCell` is already mutably borrowed, so this cannot fail.
645
648
///
646
- /// This is an associated function that needs to be used as `RefMut::map(...)`.
647
- /// A method would interfere with methods of the same name on the contents of a `RefCell`
648
- /// used through `Deref`.
649
+ /// This is an associated function that needs to be used as
650
+ /// `RefMut::map(...)`. A method would interfere with methods of the same
651
+ /// name on the contents of a `RefCell` used through `Deref`.
649
652
///
650
653
/// # Example
651
654
///
@@ -673,13 +676,14 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
673
676
}
674
677
}
675
678
676
- /// Make a new `RefMut` for a optional component of the borrowed data, e.g. an enum variant.
679
+ /// Make a new `RefMut` for a optional component of the borrowed data, e.g.
680
+ /// an enum variant.
677
681
///
678
682
/// The `RefCell` is already mutably borrowed, so this cannot fail.
679
683
///
680
- /// This is an associated function that needs to be used as `RefMut::filter_map(...)`.
681
- /// A method would interfere with methods of the same name on the contents of a `RefCell`
682
- /// used through `Deref`.
684
+ /// This is an associated function that needs to be used as
685
+ /// `RefMut::filter_map(...)`. A method would interfere with methods of the
686
+ /// same name on the contents of a `RefCell` used through `Deref`.
683
687
///
684
688
/// # Example
685
689
///
@@ -690,7 +694,9 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
690
694
/// let c = RefCell::new(Ok(5));
691
695
/// {
692
696
/// let b1: RefMut<Result<u32, ()>> = c.borrow_mut();
693
- /// let mut b2: RefMut<u32> = RefMut::filter_map(b1, |o| o.as_mut().ok()).unwrap();
697
+ /// let mut b2: RefMut<u32> = RefMut::filter_map(b1, |o| {
698
+ /// o.as_mut().ok()
699
+ /// }).unwrap();
694
700
/// assert_eq!(*b2, 5);
695
701
/// *b2 = 42;
696
702
/// }
0 commit comments