diff options
| author | Trevor Gross <t.gross35@gmail.com> | 2024-10-12 11:08:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-12 11:08:42 -0500 |
| commit | 8a86f1dd8c56ffba8df909c84d1908fb462efeba (patch) | |
| tree | c1035dac0b3d113e4ad1847c0ebcc2e522832334 /tests | |
| parent | 63a91db022f8df0ed78bfca4633e6f626eae040d (diff) | |
| parent | 187c8b0ce90eb3a446aa6bd838d6984764479a5a (diff) | |
| download | rust-8a86f1dd8c56ffba8df909c84d1908fb462efeba.tar.gz rust-8a86f1dd8c56ffba8df909c84d1908fb462efeba.zip | |
Rollup merge of #130954 - workingjubilee:stabilize-const-mut-fn, r=RalfJung
Stabilize const `ptr::write*` and `mem::replace`
Since `const_mut_refs` and `const_refs_to_cell` have been stabilized, we may now also stabilize the ability to write to places during const evaluation inside our library API. So, we now propose the `const fn` version of `ptr::write` and its variants. This allows us to also stabilize `mem::replace` and `ptr::replace`.
- const `mem::replace`: https://github.com/rust-lang/rust/issues/83164#issuecomment-2338660862
- const `ptr::write{,_bytes,_unaligned}`: https://github.com/rust-lang/rust/issues/86302#issuecomment-2330275266
Their implementation requires an additional internal stabilization of `const_intrinsic_forget`, which is required for `*::write*` and thus `*::replace`. Thus we const-stabilize the internal intrinsics `forget`, `write_bytes`, and `write_via_move`.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/consts/load-preserves-partial-init.rs | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tests/ui/consts/load-preserves-partial-init.rs b/tests/ui/consts/load-preserves-partial-init.rs index d97e9cb3d9d..2a8adbd5e16 100644 --- a/tests/ui/consts/load-preserves-partial-init.rs +++ b/tests/ui/consts/load-preserves-partial-init.rs @@ -1,6 +1,5 @@ //@ run-pass -#![feature(const_ptr_write)] // issue: https://github.com/rust-lang/rust/issues/69488 // Loads of partially-initialized data could produce completely-uninitialized results. // Test to make sure that we no longer do such a "deinitializing" load. |
