diff options
| author | bors <bors@rust-lang.org> | 2023-05-05 12:50:59 +0000 |
|---|---|---|
| committer | Albin Hedman <albin9604@gmail.com> | 2023-05-05 20:36:21 +0200 |
| commit | 81c2459af69ff726df0a1aee17b15e7616e5ef5f (patch) | |
| tree | da3c36e64b885b2d80eb1d5daa6e56118a952010 /library/core/src/ptr/mod.rs | |
| parent | 4a18324a4df6bc98bec0b54d35908d7a9cdc7c32 (diff) | |
| download | rust-81c2459af69ff726df0a1aee17b15e7616e5ef5f.tar.gz rust-81c2459af69ff726df0a1aee17b15e7616e5ef5f.zip | |
Stabilize const_ptr_read
Diffstat (limited to 'library/core/src/ptr/mod.rs')
| -rw-r--r-- | library/core/src/ptr/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 4737ff5d756..ecbf4e66fa4 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -1133,7 +1133,8 @@ pub const unsafe fn replace<T>(dst: *mut T, mut src: T) -> T { /// [valid]: self#safety #[inline] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")] +#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")] +#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces pub const unsafe fn read<T>(src: *const T) -> T { // It would be semantically correct to implement this via `copy_nonoverlapping` @@ -1249,7 +1250,8 @@ pub const unsafe fn read<T>(src: *const T) -> T { /// ``` #[inline] #[stable(feature = "ptr_unaligned", since = "1.17.0")] -#[rustc_const_unstable(feature = "const_ptr_read", issue = "80377")] +#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")] +#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces pub const unsafe fn read_unaligned<T>(src: *const T) -> T { let mut tmp = MaybeUninit::<T>::uninit(); |
