@@ -18,8 +18,6 @@ enum State<T, F> {
1818/// # Examples
1919///
2020/// ```
21- /// #![feature(lazy_cell)]
22- ///
2321/// use std::cell::LazyCell;
2422///
2523/// let lazy: LazyCell<i32> = LazyCell::new(|| {
@@ -36,7 +34,7 @@ enum State<T, F> {
3634/// // 92
3735/// // 92
3836/// ```
39- #[ unstable ( feature = "lazy_cell" , issue = "109736 " ) ]
37+ #[ stable ( feature = "lazy_cell" , since = "CURRENT_RUSTC_VERSION " ) ]
4038pub struct LazyCell < T , F = fn ( ) -> T > {
4139 state : UnsafeCell < State < T , F > > ,
4240}
@@ -47,8 +45,6 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
4745 /// # Examples
4846 ///
4947 /// ```
50- /// #![feature(lazy_cell)]
51- ///
5248 /// use std::cell::LazyCell;
5349 ///
5450 /// let hello = "Hello, World!".to_string();
@@ -58,7 +54,8 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
5854 /// assert_eq!(&*lazy, "HELLO, WORLD!");
5955 /// ```
6056 #[ inline]
61- #[ unstable( feature = "lazy_cell" , issue = "109736" ) ]
57+ #[ stable( feature = "lazy_cell" , since = "CURRENT_RUSTC_VERSION" ) ]
58+ #[ rustc_const_stable( feature = "lazy_cell" , since = "CURRENT_RUSTC_VERSION" ) ]
6259 pub const fn new ( f : F ) -> LazyCell < T , F > {
6360 LazyCell { state : UnsafeCell :: new ( State :: Uninit ( f) ) }
6461 }
@@ -70,7 +67,6 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
7067 /// # Examples
7168 ///
7269 /// ```
73- /// #![feature(lazy_cell)]
7470 /// #![feature(lazy_cell_consume)]
7571 ///
7672 /// use std::cell::LazyCell;
@@ -99,8 +95,6 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
9995 /// # Examples
10096 ///
10197 /// ```
102- /// #![feature(lazy_cell)]
103- ///
10498 /// use std::cell::LazyCell;
10599 ///
106100 /// let lazy = LazyCell::new(|| 92);
@@ -109,7 +103,7 @@ impl<T, F: FnOnce() -> T> LazyCell<T, F> {
109103 /// assert_eq!(&*lazy, &92);
110104 /// ```
111105 #[ inline]
112- #[ unstable ( feature = "lazy_cell" , issue = "109736 " ) ]
106+ #[ stable ( feature = "lazy_cell" , since = "CURRENT_RUSTC_VERSION " ) ]
113107 pub fn force ( this : & LazyCell < T , F > ) -> & T {
114108 // SAFETY:
115109 // This invalidates any mutable references to the data. The resulting
@@ -173,7 +167,7 @@ impl<T, F> LazyCell<T, F> {
173167 }
174168}
175169
176- #[ unstable ( feature = "lazy_cell" , issue = "109736 " ) ]
170+ #[ stable ( feature = "lazy_cell" , since = "CURRENT_RUSTC_VERSION " ) ]
177171impl < T , F : FnOnce ( ) -> T > Deref for LazyCell < T , F > {
178172 type Target = T ;
179173 #[ inline]
@@ -182,7 +176,7 @@ impl<T, F: FnOnce() -> T> Deref for LazyCell<T, F> {
182176 }
183177}
184178
185- #[ unstable ( feature = "lazy_cell" , issue = "109736 " ) ]
179+ #[ stable ( feature = "lazy_cell" , since = "CURRENT_RUSTC_VERSION " ) ]
186180impl < T : Default > Default for LazyCell < T > {
187181 /// Creates a new lazy value using `Default` as the initializing function.
188182 #[ inline]
@@ -191,7 +185,7 @@ impl<T: Default> Default for LazyCell<T> {
191185 }
192186}
193187
194- #[ unstable ( feature = "lazy_cell" , issue = "109736 " ) ]
188+ #[ stable ( feature = "lazy_cell" , since = "CURRENT_RUSTC_VERSION " ) ]
195189impl < T : fmt:: Debug , F > fmt:: Debug for LazyCell < T , F > {
196190 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
197191 let mut d = f. debug_tuple ( "LazyCell" ) ;
0 commit comments