Add const_cell_into_inner to OnceCell · patricklam/verify-rust-std@863123b (original) (raw)

Original file line number Diff line number Diff line change
@@ -309,7 +309,8 @@ impl OnceCell {
309 309 /// ```
310 310 #[inline]
311 311 #[stable(feature = "once_cell", since = "1.70.0")]
312 -pub fn into_inner(self) -> Option<T> {
312 +#[rustc_const_unstable(feature = "const_cell_into_inner", issue = "78729")]
313 +pub const fn into_inner(self) -> Option<T> {
313 314 // Because `into_inner` takes `self` by value, the compiler statically verifies
314 315 // that it is not currently borrowed. So it is safe to move out `Option`.
315 316 self.inner.into_inner()