diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-23 23:49:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-23 23:49:14 -0400 |
| commit | 64aa4c6e2546b88de8dbb098158839b30dc04ac6 (patch) | |
| tree | 3f488f821d7e2d97f1f44cbd16597c942c90c3e6 /compiler/rustc_hir_analysis/src/coherence/mod.rs | |
| parent | fdd4d644aa64b1426fd39fcee1d4f8b8a73322ba (diff) | |
| parent | 2787179f53d2b7904a413fc51bfe0e41f539b9b5 (diff) | |
| download | rust-64aa4c6e2546b88de8dbb098158839b30dc04ac6.tar.gz rust-64aa4c6e2546b88de8dbb098158839b30dc04ac6.zip | |
Rollup merge of #130762 - RalfJung:const_intrinsic_copy, r=dtolnay
stabilize const_intrinsic_copy
Fixes https://github.com/rust-lang/rust/issues/80697
This stabilizes
```rust
mod ptr {
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize);
}
impl *const T {
pub const unsafe fn copy_to(self, dest: *mut T, count: usize);
pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize);
}
impl *mut T {
pub const unsafe fn copy_to(self, dest: *mut T, count: usize);
pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize);
pub const unsafe fn copy_from(self, src: *const T, count: usize);
pub const unsafe fn copy_from_nonoverlapping(self, src: *const T, count: usize);
}
impl <T> NonNull<T> {
pub const unsafe fn copy_to(self, dest: NonNull<T>, count: usize);
pub const unsafe fn copy_to_nonoverlapping(self, dest: NonNull<T>, count: usize);
pub const unsafe fn copy_from(self, src: NonNull<T>, count: usize);
pub const unsafe fn copy_from_nonoverlapping(self, src: NonNull<T>, count: usize);
}
```
In particular, this reverts https://github.com/rust-lang/rust/pull/117905, which reverted https://github.com/rust-lang/rust/pull/97276.
The `NonNull` methods are not listed in the tracking issue, they were added to this feature gate in https://github.com/rust-lang/rust/pull/124498. The existing [FCP](https://github.com/rust-lang/rust/issues/80697#issuecomment-1022585839) does not cover them. They are however entirely identical to the `*mut` methods and already stable outside `const`. ``@rust-lang/libs-api`` please let me know if FCP will be required for the `NonNull` methods.
Diffstat (limited to 'compiler/rustc_hir_analysis/src/coherence/mod.rs')
0 files changed, 0 insertions, 0 deletions
