Skip to content

Commit 0c3d4cb

Browse files
authored
Rollup merge of #137928 - RalfJung:const_cell, r=m-ou-se
stabilize const_cell ``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval`` I see no reason to wait any longer, so I propose we stabilize the use of `Cell` in `const fn` -- specifically the APIs listed here: ```rust // core::cell impl<T> Cell<T> { pub const fn replace(&self, val: T) -> T; } impl<T: Copy> Cell<T> { pub const fn get(&self) -> T; } impl<T: ?Sized> Cell<T> { pub const fn get_mut(&mut self) -> &mut T; pub const fn from_mut(t: &mut T) -> &Cell<T>; } impl<T> Cell<[T]> { pub const fn as_slice_of_cells(&self) -> &[Cell<T>]; } ``` Unfortunately, `set` cannot be made `const fn` yet as it drops the old contents. Fixes rust-lang/rust#131283
2 parents eb6d674 + ed06554 commit 0c3d4cb

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)