Skip to content

Commit 749e773

Browse files
authored
Unrolled build for #144054
Rollup merge of #144054 - jsimmons:stabilize-as-array-of-cells, r=tgross35 Stabilize as_array_of_cells This PR stabilizes ```rust impl<T, const N: usize> Cell<[T; N]> { pub const fn as_array_of_cells(&self) -> &[Cell<T>; N]; } ``` Stabilization report: #88248 (comment) Closes: #88248
2 parents cd7cbe8 + 14c6e50 commit 749e773

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

library/core/src/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,14 @@ impl<T, const N: usize> Cell<[T; N]> {
698698
/// # Examples
699699
///
700700
/// ```
701-
/// #![feature(as_array_of_cells)]
702701
/// use std::cell::Cell;
703702
///
704703
/// let mut array: [i32; 3] = [1, 2, 3];
705704
/// let cell_array: &Cell<[i32; 3]> = Cell::from_mut(&mut array);
706705
/// let array_cell: &[Cell<i32>; 3] = cell_array.as_array_of_cells();
707706
/// ```
708-
#[unstable(feature = "as_array_of_cells", issue = "88248")]
707+
#[stable(feature = "as_array_of_cells", since = "CURRENT_RUSTC_VERSION")]
708+
#[rustc_const_stable(feature = "as_array_of_cells", since = "CURRENT_RUSTC_VERSION")]
709709
pub const fn as_array_of_cells(&self) -> &[Cell<T>; N] {
710710
// SAFETY: `Cell<T>` has the same memory layout as `T`.
711711
unsafe { &*(self as *const Cell<[T; N]> as *const [Cell<T>; N]) }

tests/ui/rfcs/rfc-1789-as-cell/from-mut.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ run-pass
22

3-
#![feature(as_array_of_cells)]
4-
53
use std::cell::Cell;
64

75
fn main() {

0 commit comments

Comments
 (0)