@@ -324,6 +324,7 @@ impl<T> Cell<T> {
324
324
/// let c = Cell::new(5);
325
325
/// ```
326
326
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
327
+ #[ cfg_attr( not( bootstrap) , rustc_const_stable( feature = "const_cell_new" , since = "1.32.0" ) ) ]
327
328
#[ inline]
328
329
pub const fn new ( value : T ) -> Cell < T > {
329
330
Cell {
@@ -469,6 +470,7 @@ impl<T: ?Sized> Cell<T> {
469
470
/// ```
470
471
#[ inline]
471
472
#[ stable( feature = "cell_as_ptr" , since = "1.12.0" ) ]
473
+ #[ cfg_attr( not( bootstrap) , rustc_const_stable( feature = "const_cell_as_ptr" , since = "1.32.0" ) ) ]
472
474
pub const fn as_ptr ( & self ) -> * mut T {
473
475
self . value . get ( )
474
476
}
@@ -649,6 +651,7 @@ impl<T> RefCell<T> {
649
651
/// let c = RefCell::new(5);
650
652
/// ```
651
653
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
654
+ #[ cfg_attr( not( bootstrap) , rustc_const_stable( feature = "const_refcell_new" , since = "1.32.0" ) ) ]
652
655
#[ inline]
653
656
pub const fn new ( value : T ) -> RefCell < T > {
654
657
RefCell {
@@ -1501,6 +1504,10 @@ impl<T> UnsafeCell<T> {
1501
1504
/// let uc = UnsafeCell::new(5);
1502
1505
/// ```
1503
1506
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1507
+ #[ cfg_attr(
1508
+ not( bootstrap) ,
1509
+ rustc_const_stable( feature = "const_unsafe_cell_new" , since = "1.32.0" ) ,
1510
+ ) ]
1504
1511
#[ inline]
1505
1512
pub const fn new ( value : T ) -> UnsafeCell < T > {
1506
1513
UnsafeCell { value }
@@ -1543,6 +1550,10 @@ impl<T: ?Sized> UnsafeCell<T> {
1543
1550
/// ```
1544
1551
#[ inline]
1545
1552
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1553
+ #[ cfg_attr(
1554
+ not( bootstrap) ,
1555
+ rustc_const_stable( feature = "const_unsafecell_get" , since = "1.32.0" ) ,
1556
+ ) ]
1546
1557
pub const fn get ( & self ) -> * mut T {
1547
1558
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
1548
1559
// #[repr(transparent)]. This exploits libstd's special status, there is
0 commit comments