diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-03-29 21:08:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-29 21:08:10 +0100 |
| commit | 7ef7034caf03916582053eb42be8a0422539687a (patch) | |
| tree | 227040351d769a7e4d4e4bc1279f5f0ce711fc8c /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs | |
| parent | d4812c8638173ec163825d56a72a33589483ec4c (diff) | |
| parent | e31bb45e47d78798f6b6d31316f525316bfcaecf (diff) | |
| download | rust-7ef7034caf03916582053eb42be8a0422539687a.tar.gz rust-7ef7034caf03916582053eb42be8a0422539687a.zip | |
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 https://github.com/rust-lang/rust/issues/131283
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions
